-
Notifications
You must be signed in to change notification settings - Fork 937
Maven Central Migration #6375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RanVaknin
wants to merge
9
commits into
master
Choose a base branch
from
rvaknin/mvn-central-migration-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+192
−5
Open
Maven Central Migration #6375
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e6984ce
adding maven central migration plugin, config and new buildspec
3ae75dd
Update profile config
58a5c10
fix gpg plugin
b5e8f40
Remove redundant plugin config
05922a8
force java 8 on the codebuild
ef0f88d
Fix staging dir path
0c5ee28
Fix cloudwatch reporting
d7c2773
Fix cloudwatch reporting
93479e1
Fix buildspec, add comment
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" | ||
- | | ||
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" \ | ||
RanVaknin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--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 | ||
else | ||
echo "This version was already released." | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -746,7 +747,43 @@ | |
<javadoc.skip>true</javadoc.skip> | ||
</properties> | ||
</profile> | ||
|
||
<profile> | ||
<id>central-portal-publishing</id> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a comment here explaining why we have both a normal It just might create confusion about which one we're supposed to be using. |
||
<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> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.