Skip to content

Commit

Permalink
Fix task order when releasing to Nexus
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Feb 14, 2024
1 parent cbc49aa commit ffeb05e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,20 @@ class SonatypePlugin : Plugin<Project> {
}
}

val publishToNexusProvider = try {
tasks.named("publishToNexus")
} catch (e: UnknownTaskException) {
tasks.register("publishToNexus")
}
publishToNexusProvider.configure {
tasks.named("closeRepository") {
mustRunAfter(this@configure)
}
}

addParentPublishToNexusTasks()

disallowPublishTasks()

tasks.named("closeRepository") {
mustRunAfter("publishToNexus")
}
}
}

Expand Down

0 comments on commit ffeb05e

Please sign in to comment.