Skip to content

Commit fcbb021

Browse files
authored
[build] explicitly configure nexus-publish-plugin on root project (#563)
Gradle `publish` task now explicitly depends on the `initializeSonatypeStagingRepository` task from `nexus-publish-plugin`. We need to explicitly set this as we are not publishing any artifacts from the root project.
1 parent d2d3b32 commit fcbb021

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

build.gradle.kts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616
jacoco
1717
signing
1818
`maven-publish`
19-
id("de.marcphilipp.nexus-publish") apply false
19+
id("de.marcphilipp.nexus-publish")
2020
id("io.codearte.nexus-staging")
2121
}
2222

@@ -57,15 +57,6 @@ subprojects {
5757
apply(plugin = "de.marcphilipp.nexus-publish")
5858
apply(plugin = "signing")
5959

60-
configure<NexusPublishExtension> {
61-
repositories {
62-
sonatype {
63-
username.set(System.getenv("SONATYPE_USERNAME"))
64-
password.set(System.getenv("SONATYPE_PASSWORD"))
65-
}
66-
}
67-
}
68-
6960
tasks.withType<KotlinCompile> {
7061
kotlinOptions {
7162
jvmTarget = "1.8"
@@ -178,6 +169,15 @@ subprojects {
178169
}
179170
}
180171

172+
configure<NexusPublishExtension> {
173+
repositories {
174+
sonatype {
175+
username.set(System.getenv("SONATYPE_USERNAME"))
176+
password.set(System.getenv("SONATYPE_PASSWORD"))
177+
}
178+
}
179+
}
180+
181181
tasks {
182182
jar {
183183
enabled = false
@@ -188,4 +188,6 @@ tasks {
188188

189189
packageGroup = rootProject.group.toString()
190190
}
191+
val publish by getting
192+
publish.dependsOn(":initializeSonatypeStagingRepository")
191193
}

0 commit comments

Comments
 (0)