From eaf055d563f8620696f04728a89fb31029de6d9e Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Tue, 17 Jun 2025 13:14:35 -0700 Subject: [PATCH 1/3] update using new gpg version --- aws-iot-device-sdk-java-samples/pom.xml | 1 + aws-iot-device-sdk-java/pom.xml | 2 ++ codebuild/cd/promote-release.yml | 36 ++++++++++++++----------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/aws-iot-device-sdk-java-samples/pom.xml b/aws-iot-device-sdk-java-samples/pom.xml index 3164780487..8c98b77ab6 100644 --- a/aws-iot-device-sdk-java-samples/pom.xml +++ b/aws-iot-device-sdk-java-samples/pom.xml @@ -6,6 +6,7 @@ 0.0.1-dev aws-iot-device-sdk-java-samples + ${project.groupId}:${project.artifactId} com.amazonaws diff --git a/aws-iot-device-sdk-java/pom.xml b/aws-iot-device-sdk-java/pom.xml index 91be69664b..3aa202a113 100644 --- a/aws-iot-device-sdk-java/pom.xml +++ b/aws-iot-device-sdk-java/pom.xml @@ -6,6 +6,8 @@ 0.0.1-dev aws-iot-device-sdk-java + ${project.groupId}:${project.artifactId} + The SDK is in maintenance mode, and no longer receive feature updates. Checkout aws-iot-device-sdk for new features. The AWS IoT Device SDK for Java provides Java APIs for devices to connect to AWS IoT service using the MQTT protocol. The SDK also provides support for AWS IoT specific features, such as Thing Shadow and Thing Shadow abstraction. org.mockito diff --git a/codebuild/cd/promote-release.yml b/codebuild/cd/promote-release.yml index b5d396465f..8009b78979 100644 --- a/codebuild/cd/promote-release.yml +++ b/codebuild/cd/promote-release.yml @@ -1,5 +1,5 @@ version: 0.2 -#this buildspec assumes the ubuntu 16.04:x64 image +# Assumes are running using the Ubuntu Codebuild standard image # This job is responsible for artifacting the JAR which will have all of the other shared libs stuffed # into it once all platforms are built and artifacted phases: @@ -9,8 +9,10 @@ phases: - sudo apt-get update -y - sudo apt-get install openjdk-8-jdk-headless maven -y -f - sudo apt-get install jq -y - # need latest awscli for secretsmanager - - sudo pip3 install awscli --upgrade + - echo "\nBuild version data:" + - echo "\nJava Version:"; java -version + - echo "\nMaven Version:"; mvn --version + - echo "\n" pre_build: commands: @@ -22,35 +24,37 @@ phases: - sed -i 's/0.0.1-dev/'"$PKG_VERSION"'/g' aws-iot-device-sdk-java/pom.xml - sed -i 's/0.0.1-dev/'"$PKG_VERSION"'/g' aws-iot-device-sdk-java-samples/pom.xml - sed -i 's/0.0.1-dev/'"$PKG_VERSION"'/g' aws-iot-device-sdk-java/src/main/java/com/amazonaws/services/iot/client/mqtt/AwsIotMqttConnection.java - # Get java v1 gpg files - - aws s3 cp --recursive s3://code-sharing-aws-crt/gpg-java-v1/ maven-gpg - # manully copy the maven-gpg in subfolder, since codeBuild does not set localRepository correctly - - cp -r maven-gpg aws-iot-device-sdk-java/maven-gpg - - cp -r maven-gpg aws-iot-device-sdk-java-samples/maven-gpg + # install settings.xml to ~/.m2/settings.xml - mkdir -p $HOME/.m2 - - aws s3 cp s3://code-sharing-aws-crt/iot-sdk-java-v1.settings.central.xml $HOME/.m2/settings.xml + - aws s3 cp s3://code-sharing-aws-crt/aws-iot-device-sdk.settings.token.xml $HOME/.m2/settings.xml + - aws --query "SecretString" secretsmanager get-secret-value --secret-id Sonatype/JIRA/token/V1 > sonatype_secret - jq fromjson sonatype_secret > sonatype_json - export ST_PASSWORD=$(jq -r '.password' sonatype_json) - export ESCAPED_PASSWORD=$(printf '%s\n' "$ST_PASSWORD" | sed 's:[\\/&]:\\&:g') - export ST_USERNAME=$(jq -r '.username' sonatype_json) + - aws --query "SecretString" secretsmanager get-secret-value --secret-id gpg/IoT/JAVA/V1 > gpg_secret - jq fromjson gpg_secret > gpg_json - - export GPG_PRINCIPAL=$(jq -r '.username' gpg_json) - export GPG_CREDENTIAL=$(jq -r '.password' gpg_json) - # Use the password from secret manager to update the settings - - sed -i 's/sonatype_Principal/'"$ST_USERNAME"'/g' $HOME/.m2/settings.xml - - sed -i 's/sonatype_Credential/'"$ESCAPED_PASSWORD"'/g' $HOME/.m2/settings.xml - - sed -i 's/gpg_Principal/'"$GPG_PRINCIPAL"'/g' $HOME/.m2/settings.xml - - sed -i 's/gpg_Credential/'"$GPG_CREDENTIAL"'/g' $HOME/.m2/settings.xml + # Use the username and password from secret manager to update the settings + - sed -i 's|token-username|'"$ST_USERNAME"'|g' $HOME/.m2/settings.xml + - sed -i 's|token-password|'"$ESCAPED_PASSWORD"'|g' $HOME/.m2/settings.xml + + # for https://github.com/keybase/keybase-issues/issues/2798 + - export GPG_TTY=$(tty) + + - aws s3 cp s3://code-sharing-aws-crt/aws-iot-java-sdk.asc . + - gpg --batch --import aws-iot-java-sdk.asc + - export MAVEN_GPG_PASSPHRASE=$GPG_CREDENTIAL build: commands: - cd $CODEBUILD_SRC_DIR/aws-iot-device-sdk-java - mvn -B versions:set -DnewVersion=${PKG_VERSION} - - mvn clean deploy -P publishing -Dmaven.test.skip=true + - mvn -B deploy -Dmaven.test.skip=true cache: paths: From b1a2a812fceb32f31d85ec91a8b2f3741aa9fa86 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Tue, 17 Jun 2025 13:35:15 -0700 Subject: [PATCH 2/3] add more comments --- codebuild/cd/promote-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codebuild/cd/promote-release.yml b/codebuild/cd/promote-release.yml index 8009b78979..e434d74dbf 100644 --- a/codebuild/cd/promote-release.yml +++ b/codebuild/cd/promote-release.yml @@ -48,13 +48,14 @@ phases: - aws s3 cp s3://code-sharing-aws-crt/aws-iot-java-sdk.asc . - gpg --batch --import aws-iot-java-sdk.asc + # refer to https://maven.apache.org/plugins/maven-gpg-plugin/usage.html - export MAVEN_GPG_PASSPHRASE=$GPG_CREDENTIAL build: commands: - cd $CODEBUILD_SRC_DIR/aws-iot-device-sdk-java - mvn -B versions:set -DnewVersion=${PKG_VERSION} - - mvn -B deploy -Dmaven.test.skip=true + - mvn -B clean deploy -Dmaven.test.skip=true -e -X cache: paths: From c12cad87d18c0922484d73b3fbd4164fb7ba9ed9 Mon Sep 17 00:00:00 2001 From: Vera Xia Date: Tue, 17 Jun 2025 14:14:28 -0700 Subject: [PATCH 3/3] update descriptions and comments --- aws-iot-device-sdk-java/pom.xml | 2 +- codebuild/cd/promote-release.yml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aws-iot-device-sdk-java/pom.xml b/aws-iot-device-sdk-java/pom.xml index 3aa202a113..8bc60545c7 100644 --- a/aws-iot-device-sdk-java/pom.xml +++ b/aws-iot-device-sdk-java/pom.xml @@ -7,7 +7,7 @@ aws-iot-device-sdk-java ${project.groupId}:${project.artifactId} - The SDK is in maintenance mode, and no longer receive feature updates. Checkout aws-iot-device-sdk for new features. The AWS IoT Device SDK for Java provides Java APIs for devices to connect to AWS IoT service using the MQTT protocol. The SDK also provides support for AWS IoT specific features, such as Thing Shadow and Thing Shadow abstraction. + This SDK is now in maintenance mode and will not receive new features. For the latest functionality, please use aws-iot-device-sdk. The AWS IoT Device SDK for Java lets your device applications communicate with the AWS IoT Core service over MQTT. In addition to basic MQTT messaging, it includes built-in support for AWS IoT services such as Thing Shadows, Jobs, and Fleet Provisioning. org.mockito diff --git a/codebuild/cd/promote-release.yml b/codebuild/cd/promote-release.yml index e434d74dbf..65697e5196 100644 --- a/codebuild/cd/promote-release.yml +++ b/codebuild/cd/promote-release.yml @@ -1,5 +1,5 @@ version: 0.2 -# Assumes are running using the Ubuntu Codebuild standard image +# Assumes this is running on the Ubuntu CodeBuild standard image. # This job is responsible for artifacting the JAR which will have all of the other shared libs stuffed # into it once all platforms are built and artifacted phases: diff --git a/pom.xml b/pom.xml index 950d9ed8a6..bf2dcfdf2f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 0.0.1-dev pom AWS IoT Device SDK for Java - The SDK is in maintenance mode, and no longer receive feature updates. Checkout aws-iot-device-sdk for new features. The AWS IoT Device SDK for Java provides Java APIs for devices to connect to AWS IoT service using the MQTT protocol. The SDK also provides support for AWS IoT specific features, such as Thing Shadow and Thing Shadow abstraction. + This SDK is now in maintenance mode and will not receive new features. For the latest functionality, please use aws-iot-device-sdk. The AWS IoT Device SDK for Java lets your device applications communicate with the AWS IoT Core service over MQTT. In addition to basic MQTT messaging, it includes built-in support for AWS IoT services such as Thing Shadows, Jobs, and Fleet Provisioning. https://aws.amazon.com/iot/sdk