Skip to content

Commit d1fc1a1

Browse files
author
ahmetduruer
committed
fix
1 parent f2b80b0 commit d1fc1a1

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

build.gradle.kts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ java {
160160
toolchain {
161161
languageVersion.set(JavaLanguageVersion.of(21))
162162
}
163+
// Automatically create sources and javadoc JARs
164+
withSourcesJar()
165+
withJavadocJar()
163166
}
164167

165168
kotlin {
@@ -177,19 +180,6 @@ tasks.withType<JavaCompile> {
177180
targetCompatibility = "1.8"
178181
}
179182

180-
// Configure Kotlin sources jar
181-
tasks.register<Jar>("kotlinSourcesJar") {
182-
archiveClassifier.set("sources")
183-
from(sourceSets["main"].allSource)
184-
}
185-
186-
// Configure Javadoc jar
187-
tasks.register<Jar>("javadocJar") {
188-
archiveClassifier.set("javadoc")
189-
// For Kotlin projects, we can use an empty javadoc jar or generate KDoc
190-
// Empty javadoc is acceptable for Maven Central
191-
}
192-
193183
// Publishing configuration
194184
publishing {
195185
publications {
@@ -199,10 +189,7 @@ publishing {
199189
version = project.version.toString()
200190

201191
from(components["java"])
202-
203-
// Include sources and javadoc
204-
artifact(tasks.named("kotlinSourcesJar"))
205-
artifact(tasks.named("javadocJar"))
192+
// Sources and Javadoc JARs are automatically included via withSourcesJar() and withJavadocJar()
206193

207194
pom {
208195
name.set("Parsek")

0 commit comments

Comments
 (0)