Skip to content

Commit

Permalink
Use Gradle Nexus Publish Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Feb 26, 2024
1 parent 99415f3 commit 08afbcc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions sonatype/src/main/kotlin/com/bakdata/gradle/SonatypePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ class SonatypePlugin : Plugin<Project> {
plugins.apply("base")
plugins.apply("io.github.gradle-nexus.publish-plugin")

configure<NexusPublishExtension> {
// create default repository called 'nexus' and set the corresponding default urls
repositories.create("nexus") {
nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}

allprojects {
components.matching { it.name == "java" }.configureEach {
if (extensions.findByType<PublishingExtension>() == null) {
Expand All @@ -76,14 +84,6 @@ class SonatypePlugin : Plugin<Project> {
}
}

configure<NexusPublishExtension> {
// create default repository called 'nexus' and set the corresponding default urls
repositories.create("nexus") {
nexusUrl.set(URI.create("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(URI.create("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}

disallowPublishTasks()
}
}
Expand All @@ -102,7 +102,7 @@ class SonatypePlugin : Plugin<Project> {
packageGroup.set("com.bakdata")

repositories["nexus"].apply {
stagingProfileId.set("8412378836ed9c")
stagingProfileId.set("746f6fd1d91a4")
username.set(getOverriddenSetting(SonatypeSettings::osshrUsername))
password.set(getOverriddenSetting(SonatypeSettings::osshrPassword))
getOverriddenSetting(SonatypeSettings::nexusUrl)?.let { nexusUrl.set(uri(it)) }
Expand Down

0 comments on commit 08afbcc

Please sign in to comment.