From 18e18f73ce8927779f9ab11c0615fbd2e24fda1c Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 26 Feb 2024 17:47:34 +0100 Subject: [PATCH] Use Gradle Nexus Publish Plugin --- .../src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt index 03aaf9a..2afde67 100644 --- a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt +++ b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt @@ -220,15 +220,13 @@ class SonatypePlugin : Plugin { from(tasks.findByName("javadoc") ?: tasks.findByName("dokka")) } - val sourcesJar by tasks.creating(Jar::class) { - archiveClassifier.set("sources") - from(project.the()["main"].allSource) + configure { + withSourcesJar() } configure { publications.create("sonatype") { from(components["java"]) - artifact(sourcesJar) artifact(javadocJar) } } @@ -238,7 +236,7 @@ class SonatypePlugin : Plugin { } tasks.withType { - shouldRunAfter(tasks.withType()) + mustRunAfter(tasks.withType()) } } }