diff --git a/gradle.properties b/gradle.properties index 9185171..3afbffa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ -version=1.2.6-SNAPSHOT +version=1.2.3-SNAPSHOT org.gradle.caching=true org.gradle.parallel=true diff --git a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt index 0b83d9d..0d28e2c 100644 --- a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt +++ b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt @@ -31,7 +31,6 @@ import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.attributes.DocsType.JAVADOC import org.gradle.api.logging.Logging -import org.gradle.api.plugins.JavaPlugin import org.gradle.api.plugins.JavaPluginExtension import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication @@ -221,10 +220,13 @@ class SonatypePlugin : Plugin { apply(plugin = "signing") apply(plugin = "org.gradle.maven-publish") - project.plugins.matching { it is JavaPlugin }.all { - project.tasks.matching { it.name == "dokka" }.all { + // Java and Dokka plugins might not have been applied yet + project.afterEvaluate { + tasks.findByName("dokka")?.apply { val javadocTask: Task = this - tasks.create("javadocJar") { + val main: SourceSet = + the().sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME) + tasks.create(main.javadocJarTaskName) { archiveClassifier.set(JAVADOC) from(javadocTask) }