From bb0e2043ae89d37e668efd1a7ec02224116befb6 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Mon, 12 May 2025 14:56:23 -0400 Subject: [PATCH 1/9] Update gradle-nexus/publish-plugin version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e3ed2543fef..9d217f1eb53 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ plugins { id 'de.thetaphi.forbiddenapis' version '3.8' id 'pl.allegro.tech.build.axion-release' version '1.14.4' - id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' + id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' id 'com.gradleup.shadow' version '8.3.6' apply false id 'me.champeau.jmh' version '0.7.0' apply false From 27e01a3ce537616b7fa732fdcac9fa49c329c74d Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Mon, 12 May 2025 16:01:29 -0400 Subject: [PATCH 2/9] Update URLs --- build.gradle | 3 +++ gradle/repositories.gradle | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 9d217f1eb53..95013531e15 100644 --- a/build.gradle +++ b/build.gradle @@ -103,7 +103,10 @@ nexusPublishing { allowInsecureProtocol = true } } else { + // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration sonatype { + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) username = System.getenv("SONATYPE_USERNAME") password = System.getenv("SONATYPE_PASSWORD") } diff --git a/gradle/repositories.gradle b/gradle/repositories.gradle index 41df77fa3b1..47890ec4db1 100644 --- a/gradle/repositories.gradle +++ b/gradle/repositories.gradle @@ -18,7 +18,7 @@ repositories { mavenContent { snapshotsOnly() } - url 'https://oss.sonatype.org/content/repositories/snapshots/' + url 'https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots/' } ivy { artifactPattern 'https://sqreen-ci-java.s3.amazonaws.com/jars/[organisation]/[artifact]-[revision](-[classifier]).[ext]' From fd3fa7e4f331ab66b0cddf6f34816fe3be3a35aa Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Thu, 15 May 2025 14:34:15 -0400 Subject: [PATCH 3/9] Run deploy_to_sonatype on this branch commit for now for testing --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9afc147a22e..1bf379ba23c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -740,6 +740,8 @@ deploy_to_sonatype: when: never - if: '$CI_COMMIT_BRANCH == "master"' when: on_success + - if: '$CI_COMMIT_BRANCH == "sarahchen6/migrate-to-central"' + when: on_success # Do not deploy release candidate versions - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' when: on_success From 997cc1b7e3d26073c469bc6c7264a8885de4b409 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Wed, 21 May 2025 15:14:10 +0200 Subject: [PATCH 4/9] Change comment url --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 95013531e15..65b906f9bd5 100644 --- a/build.gradle +++ b/build.gradle @@ -103,7 +103,7 @@ nexusPublishing { allowInsecureProtocol = true } } else { - // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration + // see https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-central sonatype { nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) From 6366e5820a478dc56f3fe35290466f36e5aa760b Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Thu, 22 May 2025 09:48:27 +0200 Subject: [PATCH 5/9] Update to central portal credentials --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1bf379ba23c..4f6e8e3ae6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -748,8 +748,8 @@ deploy_to_sonatype: - when: manual allow_failure: true script: - - export SONATYPE_USERNAME=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.sonatype_username --with-decryption --query "Parameter.Value" --out text) - - export SONATYPE_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.sonatype_password --with-decryption --query "Parameter.Value" --out text) + - export SONATYPE_USERNAME=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_username --with-decryption --query "Parameter.Value" --out text) + - export SONATYPE_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.central_password --with-decryption --query "Parameter.Value" --out text) - export GPG_PRIVATE_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.signing.gpg_private_key --with-decryption --query "Parameter.Value" --out text) - export GPG_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.signing.gpg_passphrase --with-decryption --query "Parameter.Value" --out text) - ./gradlew -PbuildInfo.build.number=$CI_JOB_ID publishToSonatype closeSonatypeStagingRepository -PskipTests $GRADLE_ARGS From 2530babd9ccc0bd99f5cd18b402d7927d3010823 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Fri, 27 Jun 2025 09:05:07 -0400 Subject: [PATCH 6/9] Apply suggestion for publishing and consuming snapshots from @bric3 Co-authored-by: Brice Dutheil --- gradle/repositories.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle/repositories.gradle b/gradle/repositories.gradle index 47890ec4db1..34738eacdc9 100644 --- a/gradle/repositories.gradle +++ b/gradle/repositories.gradle @@ -18,7 +18,8 @@ repositories { mavenContent { snapshotsOnly() } - url 'https://ossrh-staging-api.central.sonatype.com/content/repositories/snapshots/' + // see https://central.sonatype.org/publish/publish-portal-snapshots/#consuming-via-gradle + url 'https://central.sonatype.com/repository/maven-snapshots/' } ivy { artifactPattern 'https://sqreen-ci-java.s3.amazonaws.com/jars/[organisation]/[artifact]-[revision](-[classifier]).[ext]' From 62bf8008bd03a56e68b8cae0639a05fd7cc17a0b Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Fri, 27 Jun 2025 09:05:50 -0400 Subject: [PATCH 7/9] Apply documentation suggestion from @bric3 Co-authored-by: Brice Dutheil --- build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 65b906f9bd5..65342106bdc 100644 --- a/build.gradle +++ b/build.gradle @@ -104,7 +104,10 @@ nexusPublishing { } } else { // see https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-central - sonatype { + // Also for official doc + // staging repo publishing https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration + // snapshot publishing https://central.sonatype.org/publish/publish-portal-snapshots/#publishing-via-other-methods +sonatype { nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) username = System.getenv("SONATYPE_USERNAME") From 3176f23b8c0eb9c1eb096272a7e500c0112f4ed7 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Fri, 27 Jun 2025 09:20:53 -0400 Subject: [PATCH 8/9] Clean comments --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 65342106bdc..ac0bd29d117 100644 --- a/build.gradle +++ b/build.gradle @@ -92,7 +92,7 @@ nexusPublishing { def forceLocal = project.hasProperty('forceLocal') && forceLocal if (forceLocal && !isCI) { local { - // For testing use with https://hub.docker.com/r/sonatype/nexus + // For testing, use with https://hub.docker.com/r/sonatype/nexus // docker run --rm -d -p 8081:8081 --name nexus sonatype/nexus:oss // ./gradlew publishToLocal // Doesn't work for testing releases though... (due to staging) @@ -104,10 +104,10 @@ nexusPublishing { } } else { // see https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-central - // Also for official doc + // For official documentation: // staging repo publishing https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration // snapshot publishing https://central.sonatype.org/publish/publish-portal-snapshots/#publishing-via-other-methods -sonatype { + sonatype { nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) username = System.getenv("SONATYPE_USERNAME") From 9d86f887401052689ccdc0c4479ce14bb611191a Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Fri, 27 Jun 2025 09:26:51 -0400 Subject: [PATCH 9/9] Remove testing of deploy_to_sonatype on this branch --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f6e8e3ae6d..5d406f0d751 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -740,8 +740,6 @@ deploy_to_sonatype: when: never - if: '$CI_COMMIT_BRANCH == "master"' when: on_success - - if: '$CI_COMMIT_BRANCH == "sarahchen6/migrate-to-central"' - when: on_success # Do not deploy release candidate versions - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' when: on_success