Skip to content

Commit 064dfdc

Browse files
committed
Replace archives conf by maven-publish
1 parent 2a20bff commit 064dfdc

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

build.gradle.kts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
id("java")
66
id("java-library")
77
id("signing")
8+
id("maven-publish")
89
}
910

1011
repositories {
@@ -82,14 +83,19 @@ tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJ
8283
archiveClassifier.set("")
8384
}
8485

85-
artifacts {
86-
add("archives", tasks.named("shadowJar"))
86+
publishing {
87+
publications {
88+
create<MavenPublication>("shadow") {
89+
artifact(tasks.shadowJar) {
90+
classifier = "" // ensure no "-all" suffix
91+
}
92+
}
93+
}
8794
}
8895

8996
signing {
9097
useGpgCmd()
91-
// Sign both the sources JAR and the shadow JAR
92-
sign(configurations.getByName("archives"))
98+
sign(publishing.publications["shadow"])
9399
}
94100

95101
tasks.withType<JavaCompile> {

0 commit comments

Comments
 (0)