maven-publish
插件以“project-1.0-all.jar”格式发布名称的 JAR
我使用了 Maven,一切正常。现在我已经使用 maven-publish 插件迁移到 Gradle。
这是我的publishing
Gradle 构建脚本部分
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) }
}
}
}
这是我的完整构建脚本。
预期的:
以“project-1.0.jar”格式命名的 JAR 已发布。
实际的:
名称格式为“project-1.0-all.jar”的 JAR 已发布。