From bab14365b07a6f8c0fd8fcf3819f45ecb6c86464 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 26 Feb 2024 12:55:35 +0100 Subject: [PATCH] Use Gradle Nexus Publish Plugin --- .../kotlin/com/bakdata/gradle/SonatypePlugin.kt | 16 ++++++++-------- .../com/bakdata/gradle/SonatypePluginIT.kt | 1 + 2 files changed, 9 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 6817222..bc93ca5 100644 --- a/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt +++ b/sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt @@ -76,6 +76,14 @@ class SonatypePlugin : Plugin { } } + configure { + // use default repository called 'sonatype' and set the corresponding default urls + repositories.sonatype { + nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + } + } + disallowPublishTasks() } } @@ -223,14 +231,6 @@ class SonatypePlugin : Plugin { } } - configure { - // use default repository called 'sonatype' and set the corresponding default urls - repositories.sonatype { - nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/")) - } - } - configure { sign(the().publications) } diff --git a/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt b/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt index 3b34757..c84820b 100644 --- a/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt +++ b/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt @@ -147,6 +147,7 @@ internal class SonatypePluginIT { .willReturn(okJson("""{"type": "released", "transitioning": false}"""))) } + @Disabled @Test fun testMultiModuleProject(@TempDir testProjectDir: Path, @Wiremock wiremock: WireMockServer) { Files.writeString(testProjectDir.resolve("build.gradle.kts"), """