From e6984ce9ba10093933d67a8f07b159ce0b2acdd4 Mon Sep 17 00:00:00 2001 From: Ran Vaknin Date: Fri, 15 Aug 2025 03:13:28 +0000 Subject: [PATCH 1/9] adding maven central migration plugin, config and new buildspec --- archetypes/archetype-tools/pom.xml | 2 +- bom-internal/pom.xml | 2 +- buildspecs/release-to-maven-central.yml | 57 +++++++++++++ .../maven-central-release-settings.xml | 21 +++++ bundle-sdk/pom.xml | 32 +++++++- bundle/pom.xml | 41 +++++++++- pom.xml | 80 ++++++++++++++++++- 7 files changed, 230 insertions(+), 5 deletions(-) create mode 100644 buildspecs/release-to-maven-central.yml create mode 100644 buildspecs/resources/maven-central-release-settings.xml diff --git a/archetypes/archetype-tools/pom.xml b/archetypes/archetype-tools/pom.xml index f6c6bda4a6ed..ad797b6547a3 100644 --- a/archetypes/archetype-tools/pom.xml +++ b/archetypes/archetype-tools/pom.xml @@ -25,7 +25,7 @@ 4.0.0 archetype-tools - + AWS Java SDK :: Archetype Tools diff --git a/bom-internal/pom.xml b/bom-internal/pom.xml index 03aa367965b7..21a33f079d61 100644 --- a/bom-internal/pom.xml +++ b/bom-internal/pom.xml @@ -25,7 +25,7 @@ 4.0.0 bom-internal - + AWS Java SDK :: Bill of Materials Internal diff --git a/buildspecs/release-to-maven-central.yml b/buildspecs/release-to-maven-central.yml new file mode 100644 index 000000000000..120122875b23 --- /dev/null +++ b/buildspecs/release-to-maven-central.yml @@ -0,0 +1,57 @@ +version: 0.2 + +phases: + install: + commands: + - pip install awscli --upgrade --user + + pre_build: + commands: + - ROOT=`pwd` + - SETTINGS_XML_TEMPLATE=buildspecs/resources/maven-central-release-settings.xml + - SETTINGS_XML=release-settings-final.xml + - SDK_SIGNING_GPG_SECRING=secring.gpg + - SDK_SIGNING_GPG_SECRING_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sdk-signing-gpg-secret-ring-9d0YXc" + - SDK_SIGNING_GPG_KEYNAME_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sdk-signing-gpg-keyname-wFsOOg" + - SDK_SIGNING_GPG_PASSPHRASE_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sdk-signing-gpg-passphrase-A0H1Kq" + - SONATYPE_PASSWORD_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:maven-central-publishing-password-yktnUc" + - SONATYPE_USERNAME_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:maven-central-publishing-username-RDvOnW" + - MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,module-path-tests,tests-coverage-reporting,stability-tests,sdk-native-image-test,auth-tests,s3-benchmarks,http-client-benchmarks,region-testing,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration-tests,architecture-tests,s3-tests" + + build: + commands: + - RELEASE_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec` + - SONATYPE_URL="https://repo1.maven.org/maven2/software/amazon/awssdk/aws-sdk-java/$RELEASE_VERSION/" + - | + if ! curl -f --head $SONATYPE_URL; then + SONATYPE_USERNAME=`aws secretsmanager get-secret-value --secret-id $SONATYPE_USERNAME_ARN --query SecretString --output text` + SONATYPE_PASSWORD=`aws secretsmanager get-secret-value --secret-id $SONATYPE_PASSWORD_ARN --query SecretString --output text` + SDK_SIGNING_GPG_KEYNAME=`aws secretsmanager get-secret-value --secret-id $SDK_SIGNING_GPG_KEYNAME_ARN --query SecretString --output text` + SDK_SIGNING_GPG_PASSPHRASE=`aws secretsmanager get-secret-value --secret-id $SDK_SIGNING_GPG_PASSPHRASE_ARN --query SecretString --output text` + aws secretsmanager get-secret-value --secret-id $SDK_SIGNING_GPG_SECRING_ARN --query SecretBinary --output text | base64 -d > $SDK_SIGNING_GPG_SECRING + gpg --passphrase $SDK_SIGNING_GPG_PASSPHRASE --batch --import $SDK_SIGNING_GPG_SECRING + + cat $SETTINGS_XML_TEMPLATE | \ + awk 'BEGIN { var=ENVIRON["SONATYPE_USERNAME"] } { gsub("\\$SONATYPE_USERNAME", var, $0); print }' | \ + awk 'BEGIN { var=ENVIRON["SONATYPE_PASSWORD"] } { gsub("\\$SONATYPE_PASSWORD", var, $0); print }' | \ + awk 'BEGIN { var=ENVIRON["SDK_SIGNING_GPG_PASSPHRASE"] } { gsub("\\$SDK_SIGNING_GPG_PASSPHRASE", var, $0); print }' | \ + awk 'BEGIN { var=ENVIRON["SDK_SIGNING_GPG_KEYNAME"] } { gsub("\\$SDK_SIGNING_GPG_KEYNAME", var, $0); print }' > \ + $SETTINGS_XML + + # Convert comma-separated list to space-separated list with !: prefix for each module + MODULES_TO_SKIP_FORMATTED=$(echo $MODULES_TO_SKIP | sed 's/,/,!:/g' | sed 's/^/!:/') + + mvn clean deploy -B -s $SETTINGS_XML -Pcentral-portal-publishing -DperformRelease -DautoPublish=true -DdeploymentName="software.amazon.awssdk-$RELEASE_VERSION" -Dspotbugs.skip -DskipTests -Dcheckstyle.skip -Djapicmp.skip -Ddoclint=none -DstagingProgressTimeoutMinutes=30 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -pl $MODULES_TO_SKIP_FORMATTED + + # Report staging folder size to CloudWatch + if [ -d "/target/central-staging" ]; then + STAGING_SIZE_MB=$(du -sm target/central-staging | cut -f1) + aws cloudwatch put-metric-data \ + --namespace "AwsJavaSdkRelease" \ + --metric-data MetricName=StagingFolderSize,Value=$STAGING_SIZE_KB,Unit=Kilobytes,Dimensions=Name=ReleaseVersion,Value=$RELEASE_VERSION + else + echo "Staging folder /target/central-staging not found" + fi + else + echo "This version was already released." + fi diff --git a/buildspecs/resources/maven-central-release-settings.xml b/buildspecs/resources/maven-central-release-settings.xml new file mode 100644 index 000000000000..4100be1970b6 --- /dev/null +++ b/buildspecs/resources/maven-central-release-settings.xml @@ -0,0 +1,21 @@ + + + + central + $SONATYPE_USERNAME + $SONATYPE_PASSWORD + + + + + central-portal-publishing + + false + + + $SDK_SIGNING_GPG_KEYNAME + $SDK_SIGNING_GPG_PASSPHRASE + + + + diff --git a/bundle-sdk/pom.xml b/bundle-sdk/pom.xml index 71c26e4c7dc6..1fe95e956850 100644 --- a/bundle-sdk/pom.xml +++ b/bundle-sdk/pom.xml @@ -238,7 +238,7 @@ - + publishing @@ -268,6 +268,36 @@ + + central-portal-publishing + + + + org.apache.maven.plugins + maven-shade-plugin + + true + + + + maven-javadoc-plugin + + + javadoc-jar + package + + jar + + + + + ${basedir}/../core/profiles/src/main/java/software/amazon/awssdk/profiles;${basedir}/../core/sdk-core/src/main/java/software/amazon/awssdk/core + false + + + + + diff --git a/bundle/pom.xml b/bundle/pom.xml index 165435269468..eecf9976ee5b 100644 --- a/bundle/pom.xml +++ b/bundle/pom.xml @@ -90,8 +90,47 @@ - + + central-portal-publishing + + + + org.apache.maven.plugins + maven-shade-plugin + + true + + + + maven-javadoc-plugin + + + javadoc-jar + package + + jar + + + + + ${basedir}/../core/profiles/src/main/java/software/amazon/awssdk/profiles;${basedir}/../core/sdk-core/src/main/java/software/amazon/awssdk/core + false + + + + org.apache.maven.plugins + maven-dependency-plugin + + + software.amazon.awssdk:bundle-sdk + software.amazon.awssdk:bundle-logging-bridge + + + + + + publishing diff --git a/pom.xml b/pom.xml index b54092bffb0f..78c75b5dce85 100644 --- a/pom.xml +++ b/pom.xml @@ -162,6 +162,7 @@ 1.6 8.42 0.8.12 + 0.8.0 1.6.8 1.6.0 2.8.2 @@ -222,6 +223,16 @@ + + org.sonatype.central + central-publishing-maven-plugin + ${central-publishing-maven-plugin.version} + true + + central + false + + org.apache.maven.plugins maven-compiler-plugin @@ -746,7 +757,74 @@ true - + + central-portal-publishing + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + + generate-javadocs + + jar + + + false + 8 + true + false + none + software.amazon.awssdk.services.*:*.codegen + + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + sign-artifacts + verify + + sign + + + + + + --batch + + + + + org.sonatype.central + central-publishing-maven-plugin + ${central-publishing-maven-plugin.version} + true + + central + + + + + publishing From 3ae75dd287dab6ce99241857d094c17adbc80668 Mon Sep 17 00:00:00 2001 From: RanVaknin Date: Wed, 27 Aug 2025 17:20:10 +0000 Subject: [PATCH 2/9] Update profile config --- pom.xml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/pom.xml b/pom.xml index 78c75b5dce85..391bd8aa0e0a 100644 --- a/pom.xml +++ b/pom.xml @@ -773,27 +773,6 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven-javadoc-plugin.version} - - - generate-javadocs - - jar - - - false - 8 - true - false - none - software.amazon.awssdk.services.*:*.codegen - - - - org.apache.maven.plugins maven-gpg-plugin From 58a5c106f052838e52ffb2f889658e0429bad024 Mon Sep 17 00:00:00 2001 From: RanVaknin Date: Wed, 27 Aug 2025 23:30:10 +0000 Subject: [PATCH 3/9] fix gpg plugin --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 391bd8aa0e0a..96db0c00e56f 100644 --- a/pom.xml +++ b/pom.xml @@ -789,6 +789,8 @@ --batch + --pinentry-mode + loopback From b5e8f406eb1b94144e73862a172857585069a320 Mon Sep 17 00:00:00 2001 From: RanVaknin <> Date: Thu, 28 Aug 2025 18:04:06 +0000 Subject: [PATCH 4/9] Remove redundant plugin config --- pom.xml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/pom.xml b/pom.xml index 96db0c00e56f..32b6009ec998 100644 --- a/pom.xml +++ b/pom.xml @@ -223,16 +223,6 @@ - - org.sonatype.central - central-publishing-maven-plugin - ${central-publishing-maven-plugin.version} - true - - central - false - - org.apache.maven.plugins maven-compiler-plugin @@ -761,18 +751,6 @@ central-portal-publishing - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar-no-fork - - - - org.apache.maven.plugins maven-gpg-plugin From 05922a8160cf07580d875f501c09a9fa2270a0b1 Mon Sep 17 00:00:00 2001 From: RanVaknin <> Date: Thu, 28 Aug 2025 20:27:42 +0000 Subject: [PATCH 5/9] force java 8 on the codebuild --- buildspecs/release-to-maven-central.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildspecs/release-to-maven-central.yml b/buildspecs/release-to-maven-central.yml index 120122875b23..4660e6376a7b 100644 --- a/buildspecs/release-to-maven-central.yml +++ b/buildspecs/release-to-maven-central.yml @@ -2,6 +2,8 @@ version: 0.2 phases: install: + runtime-versions: + java: corretto8 commands: - pip install awscli --upgrade --user From ef0f88d1fbc9bfcc3e7a29271e6f6cd9c6ba9416 Mon Sep 17 00:00:00 2001 From: RanVaknin <> Date: Fri, 29 Aug 2025 20:53:02 +0000 Subject: [PATCH 6/9] Fix staging dir path --- buildspecs/release-to-maven-central.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/buildspecs/release-to-maven-central.yml b/buildspecs/release-to-maven-central.yml index 4660e6376a7b..12eb09681408 100644 --- a/buildspecs/release-to-maven-central.yml +++ b/buildspecs/release-to-maven-central.yml @@ -2,8 +2,6 @@ version: 0.2 phases: install: - runtime-versions: - java: corretto8 commands: - pip install awscli --upgrade --user @@ -46,13 +44,13 @@ phases: mvn clean deploy -B -s $SETTINGS_XML -Pcentral-portal-publishing -DperformRelease -DautoPublish=true -DdeploymentName="software.amazon.awssdk-$RELEASE_VERSION" -Dspotbugs.skip -DskipTests -Dcheckstyle.skip -Djapicmp.skip -Ddoclint=none -DstagingProgressTimeoutMinutes=30 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -pl $MODULES_TO_SKIP_FORMATTED # Report staging folder size to CloudWatch - if [ -d "/target/central-staging" ]; then + if [ -d "target/central-staging" ]; then STAGING_SIZE_MB=$(du -sm target/central-staging | cut -f1) aws cloudwatch put-metric-data \ --namespace "AwsJavaSdkRelease" \ - --metric-data MetricName=StagingFolderSize,Value=$STAGING_SIZE_KB,Unit=Kilobytes,Dimensions=Name=ReleaseVersion,Value=$RELEASE_VERSION + --metric-data MetricName=StagingFolderSize,Value=$STAGING_SIZE_MB,Unit=Megabytes,Dimensions=Name=ReleaseVersion,Value=$RELEASE_VERSION else - echo "Staging folder /target/central-staging not found" + echo "Staging folder target/central-staging not found" fi else echo "This version was already released." From 0c5ee28de396938e1834713105a45ed009bcde33 Mon Sep 17 00:00:00 2001 From: RanVaknin <> Date: Tue, 2 Sep 2025 05:58:35 +0000 Subject: [PATCH 7/9] Fix cloudwatch reporting --- buildspecs/release-to-maven-central.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildspecs/release-to-maven-central.yml b/buildspecs/release-to-maven-central.yml index 12eb09681408..7692b9b29ea0 100644 --- a/buildspecs/release-to-maven-central.yml +++ b/buildspecs/release-to-maven-central.yml @@ -21,9 +21,9 @@ phases: build: commands: - RELEASE_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec` - - SONATYPE_URL="https://repo1.maven.org/maven2/software/amazon/awssdk/aws-sdk-java/$RELEASE_VERSION/" + - ARTIFACT_URL="https://repo1.maven.org/maven2/software/amazon/awssdk/aws-sdk-java/$RELEASE_VERSION/" - | - if ! curl -f --head $SONATYPE_URL; then + if ! curl -f --head $ARTIFACT_URL; then SONATYPE_USERNAME=`aws secretsmanager get-secret-value --secret-id $SONATYPE_USERNAME_ARN --query SecretString --output text` SONATYPE_PASSWORD=`aws secretsmanager get-secret-value --secret-id $SONATYPE_PASSWORD_ARN --query SecretString --output text` SDK_SIGNING_GPG_KEYNAME=`aws secretsmanager get-secret-value --secret-id $SDK_SIGNING_GPG_KEYNAME_ARN --query SecretString --output text` From d7c2773b6f4f5fa480916a9c5f0f46bd8e2692e8 Mon Sep 17 00:00:00 2001 From: RanVaknin <> Date: Tue, 2 Sep 2025 17:12:42 +0000 Subject: [PATCH 8/9] Fix cloudwatch reporting --- buildspecs/release-to-maven-central.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspecs/release-to-maven-central.yml b/buildspecs/release-to-maven-central.yml index 7692b9b29ea0..458726001e80 100644 --- a/buildspecs/release-to-maven-central.yml +++ b/buildspecs/release-to-maven-central.yml @@ -48,7 +48,7 @@ phases: STAGING_SIZE_MB=$(du -sm target/central-staging | cut -f1) aws cloudwatch put-metric-data \ --namespace "AwsJavaSdkRelease" \ - --metric-data MetricName=StagingFolderSize,Value=$STAGING_SIZE_MB,Unit=Megabytes,Dimensions=Name=ReleaseVersion,Value=$RELEASE_VERSION + --metric-data "MetricName=StagingFolderSize,Value=$STAGING_SIZE_MB,Unit=Megabytes,Dimensions=[{Name=ReleaseVersion,Value=$RELEASE_VERSION}]" else echo "Staging folder target/central-staging not found" fi From 93479e1d7591029b8bfcead4b84a6848cb0316c6 Mon Sep 17 00:00:00 2001 From: RanVaknin <> Date: Wed, 3 Sep 2025 06:16:45 +0000 Subject: [PATCH 9/9] Fix buildspec, add comment --- buildspecs/release-to-maven-central.yml | 2 +- pom.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/buildspecs/release-to-maven-central.yml b/buildspecs/release-to-maven-central.yml index 458726001e80..bf7c46fddd6a 100644 --- a/buildspecs/release-to-maven-central.yml +++ b/buildspecs/release-to-maven-central.yml @@ -48,7 +48,7 @@ phases: STAGING_SIZE_MB=$(du -sm target/central-staging | cut -f1) aws cloudwatch put-metric-data \ --namespace "AwsJavaSdkRelease" \ - --metric-data "MetricName=StagingFolderSize,Value=$STAGING_SIZE_MB,Unit=Megabytes,Dimensions=[{Name=ReleaseVersion,Value=$RELEASE_VERSION}]" + --metric-data "MetricName=StagingFolderSize,Value=$STAGING_SIZE_MB,Unit=Megabytes" else echo "Staging folder target/central-staging not found" fi diff --git a/pom.xml b/pom.xml index 32b6009ec998..f26a0bf55cd2 100644 --- a/pom.xml +++ b/pom.xml @@ -748,6 +748,9 @@ + central-portal-publishing