From 525ac68f6611bae3e56880e2ac1ae0b06631ee94 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Wed, 28 Feb 2024 13:00:00 +0100 Subject: [PATCH] Update --- .../kotlin/com/bakdata/gradle/SonatypePlugin.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt index e12ecf8..0b83d9d 100644 --- a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt +++ b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt @@ -221,16 +221,15 @@ class SonatypePlugin : Plugin { apply(plugin = "signing") apply(plugin = "org.gradle.maven-publish") - project.tasks.matching { it.name == "dokkaJavadoc" }.all { - val javadocTask: Task = this - val main: SourceSet = the().sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME) - tasks.create(main.javadocJarTaskName) { - archiveClassifier.set(JAVADOC) - from(javadocTask) + project.plugins.matching { it is JavaPlugin }.all { + project.tasks.matching { it.name == "dokka" }.all { + val javadocTask: Task = this + tasks.create("javadocJar") { + archiveClassifier.set(JAVADOC) + from(javadocTask) + } } - } - project.plugins.matching { it is JavaPlugin }.all { configure { withSourcesJar() withJavadocJar()