Skip to content

Commit 18484d3

Browse files
committed
fix: fixed main jar is confused with -api jar
1 parent 82d0241 commit 18484d3

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ tasks {
108108
}
109109
}
110110

111+
tasks.named<Jar>("jar") {
112+
// Keep jar enabled for Maven publishing
113+
enabled = true
114+
// Add custom naming: v before version and -api before .jar
115+
if (version != "unspecified") {
116+
archiveFileName.set("${rootProject.name}-v${version}-api.jar")
117+
} else {
118+
archiveFileName.set("${rootProject.name}-api.jar")
119+
}
120+
}
121+
111122
java {
112123
// Use Java 21 for compilation
113124
toolchain {

0 commit comments

Comments
 (0)