Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion archetypes/archetype-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>archetype-tools</artifactId>

<name>AWS Java SDK :: Archetype Tools</name>
<dependencies>
<!-- Depends on the artifacts of all services to generate serviceMapping.vm -->
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>bom-internal</artifactId>

<name>AWS Java SDK :: Bill of Materials Internal</name>
<dependencyManagement>
<dependencies>
<!-- Non-Test Dependencies -->
Expand Down
57 changes: 57 additions & 0 deletions buildspecs/release-to-maven-central.yml
Original file line number Diff line number Diff line change
@@ -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`
- ARTIFACT_URL="https://repo1.maven.org/maven2/software/amazon/awssdk/aws-sdk-java/$RELEASE_VERSION/"
Copy link
Contributor

@dagnir dagnir Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious about this change. With OSSRH, we query the Nexus instance directly since there's a lag between publishing to the nexus instance and it being available through Maven (i.e. at https://repo1.maven.org).

Is there a similar "pre-Maven" URL that we can hit for Central publishing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a great question. I changed this to target the CDN because the existing polling endpoint "https://aws.oss.sonatype.org/service/local/repositories/releases/content/software/amazon/awssdk/aws-sdk-java/$RELEASE_VERSION/" is hosted on the nexus2 server. I was not sure if this will "go away" and if central will have it own server for hosting. I assume if it does happen the CDN will just get routed to that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should keep it pointing to the oss endpoint?

- |
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`
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_MB,Unit=Megabytes"
else
echo "Staging folder target/central-staging not found"
fi
else
echo "This version was already released."
fi
21 changes: 21 additions & 0 deletions buildspecs/resources/maven-central-release-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<settings>
<servers>
<server>
<id>central</id>
<username>$SONATYPE_USERNAME</username>
<password>$SONATYPE_PASSWORD</password>
</server>
</servers>
<profiles>
<profile>
<id>central-portal-publishing</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<gpg.keyname>$SDK_SIGNING_GPG_KEYNAME</gpg.keyname>
<gpg.passphrase>$SDK_SIGNING_GPG_PASSPHRASE</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
32 changes: 31 additions & 1 deletion bundle-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
</build>

<profiles>
<profile>
<profile>
<id>publishing</id>
<build>
<plugins>
Expand Down Expand Up @@ -268,6 +268,36 @@
</plugins>
</build>
</profile>
<profile>
<id>central-portal-publishing</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createSourcesJar>true</createSourcesJar>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<sourcepath>${basedir}/../core/profiles/src/main/java/software/amazon/awssdk/profiles;${basedir}/../core/sdk-core/src/main/java/software/amazon/awssdk/core</sourcepath>
<failOnError>false</failOnError>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
41 changes: 40 additions & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,47 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>central-portal-publishing</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createSourcesJar>true</createSourcesJar>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<sourcepath>${basedir}/../core/profiles/src/main/java/software/amazon/awssdk/profiles;${basedir}/../core/sdk-core/src/main/java/software/amazon/awssdk/core</sourcepath>
<failOnError>false</failOnError>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>software.amazon.awssdk:bundle-sdk</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>software.amazon.awssdk:bundle-logging-bridge</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>publishing</id>
<build>
Expand Down
42 changes: 41 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<checkstyle.version>8.42</checkstyle.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<central-publishing-maven-plugin.version>0.8.0</central-publishing-maven-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
Expand Down Expand Up @@ -746,7 +747,46 @@
<javadoc.skip>true</javadoc.skip>
</properties>
</profile>

<profile>
<!-- This is the new maven publishing profile. It's similar to the "publishing" profile except
for the fact that it uses the maven central publishing plugin instead of the nexus publishing plugin.
Once OSSRH is disabled we can rename this "publishing", and remove the existing publishing profile -->
<id>central-portal-publishing</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<arg>--batch</arg>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central-publishing-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>publishing</id>
<build>
Expand Down
Loading