Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

273
Visualizações
Remove "-all" suffix in name of JAR, when it is published by maven-publish gradle plugin

maven-publish plugin posts JAR with name in format of "project-1.0-all.jar"

I used Maven, everything was OK. Now I've migrated to Gradle with maven-publish plugin.

Here is my publishing Gradle build-script section

    publishing {
        publications {
            create<MavenPublication>("mavenJava") {
                artifact(this@run["shadowJar"])
                pom {

                    artifactId = project.name
                    groupId = project.group.toString()
                    packaging = "jar"

                    name.set(project.name)
                    description.set(project.description)
                    url.set("https://gitlab.com/otherwise.su/config")
                    inceptionYear.set("2018")
                    licenses {
                        license {
                            comments.set("Open-source license")
                            distribution.set("repo")
                            name.set("Лицензия")
                            url.set("https://gitlab.com/otherwise.su/config/blob/master/LICENSE.md")
                        }
                    }
                    developers {
                        developer {
                            email.set("postovalovya@gmail.com")
                            id.set("CMDR_Tvis")
                            name.set("Commander Tvis")
                            roles.set(listOf("architect", "developer"))
                            timezone.set("Russian Federation/Novosibirsk")
                            url.set("https://gitlab.com/CMDR_Tvis")
                        }
                    }

                }
            }
        }
        repositories {
            maven("https://gitlab.com/api/v4/projects/10077943/packages/maven") {
                credentials(HttpHeaderCredentials::class) {
                    name = "Job-Token"
                    value = System.getenv("CI_JOB_TOKEN")
                }
                authentication { register("header", HttpHeaderAuthentication::class) }
            }
        }
    }

Here's my full build-script.

Expected:

JAR with name by format "project-1.0.jar" is published.

Actual:

JAR with name by format "project-1.0-all.jar is published.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

To change the JAR classifier for the published artifact, replace

artifact(this@run["shadowJar"])

with

artifact(this@run["shadowJar"]) {
    classifier = null
}

This should remove the all suffix that is set as a classifier by the Shadow plugin.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda