diff --git a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt index 2fbf514..057f353 100644 --- a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt +++ b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt @@ -215,9 +215,11 @@ class SonatypePlugin : Plugin { apply(plugin = "signing") apply(plugin = "org.gradle.maven-publish") - val javadocJar by tasks.creating(Jar::class) { - archiveClassifier.set("javadoc") - from(tasks.findByName("javadoc") ?: tasks.findByName("dokka")) + tasks.findByName("dokka")?.apply { + tasks.creating(Jar::class) { + archiveClassifier.set("javadoc") + from(this) + } } configure {