File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,17 @@ tasks.named<Jar>("jar") {
169169 }
170170}
171171
172+ java {
173+ // Use Java 21 for compilation
174+ toolchain {
175+ languageVersion.set(JavaLanguageVersion .of(21 ))
176+ }
177+ // Automatically create sources and javadoc JARs
178+ withSourcesJar()
179+ withJavadocJar()
180+ }
181+
182+ // Configure sources and javadoc jars after they are created
172183tasks.named<Jar >(" sourcesJar" ) {
173184 // Add custom naming: v before version and -api before .jar
174185 if (version != " unspecified" ) {
@@ -187,16 +198,6 @@ tasks.named<Jar>("javadocJar") {
187198 }
188199}
189200
190- java {
191- // Use Java 21 for compilation
192- toolchain {
193- languageVersion.set(JavaLanguageVersion .of(21 ))
194- }
195- // Automatically create sources and javadoc JARs
196- withSourcesJar()
197- withJavadocJar()
198- }
199-
200201kotlin {
201202 jvmToolchain(21 ) // Ensure Kotlin uses the Java 21 toolchain
202203}
You can’t perform that action at this time.
0 commit comments