diff --git a/build.gradle b/build.gradle index 25154c7314..9e13aaa608 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,7 @@ import nebula.plugin.release.git.opinion.Strategies plugins { id 'idea' + id "io.codearte.nexus-staging" version "0.22.0" id "nebula.release" version "15.3.0" id 'org.gradle.test-retry' version '1.2.0' apply false @@ -28,6 +29,13 @@ nebulaRelease { addReleaseBranchPattern(/v\d+\.\d+\.x/) } +nexusStaging { + // We publish to two package groups so need to close each group individually until staging profile + // is set up. We'll run the command twice with the two groups. + // TODO(anuraaga): https://issues.sonatype.org/browse/OSSRH-62444 + packageGroup = findProperty("mavenCentralGroup") +} + allprojects { apply from: "$rootDir/gradle/dependencies.gradle" apply from: "$rootDir/gradle/util.gradle" diff --git a/gradle/publish.gradle b/gradle/publish.gradle index f28f0460b3..d2d251bd0c 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -4,12 +4,18 @@ apply plugin: 'signing' publishing { repositories { maven { - url = version.toString().contains('SNAPSHOT') - ? "https://oss.jfrog.org/artifactory/oss-snapshot-local/" - : "https://api.bintray.com/maven/open-telemetry/maven/opentelemetry-java-instrumentation/" - credentials { - username = System.getenv('BINTRAY_USER') - password = System.getenv('BINTRAY_API_KEY') + if (version.toString().contains('SNAPSHOT')) { + url = "https://oss.jfrog.org/artifactory/oss-snapshot-local/" + credentials { + username = System.getenv('BINTRAY_USER') + password = System.getenv('BINTRAY_API_KEY') + } + } else { + url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + credentials { + username = System.getenv('SONATYPE_USER') + password = System.getenv('SONATYPE_KEY') + } } } }