Skip to content

Commit 0f42193

Browse files
authored
Merge branch 'master' into presign-head-object
2 parents 8764683 + ad72c71 commit 0f42193

File tree

90 files changed

+11978
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+11978
-3
lines changed

.brazil.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
"dynamodb": { "packageName": "AwsJavaSdk-DynamoDb" },
4848
"waf": { "packageName": "AwsJavaSdk-Waf" },
49+
"v2-migration": { "packageName": "AwsJavaSdk-Tooling-V2Migration"},
4950

5051
"third-party-jackson-core": {
5152
"packageName": "AwsJavaSdk-ThirdParty-JacksonCore",
@@ -105,6 +106,7 @@
105106
"tests-coverage-reporting": { "skipImport": true },
106107
"third-party": { "skipImport": true },
107108
"third-party-slf4j-api": { "skipImport": true },
109+
"v2-migration-tests": {"skipImport": true},
108110
"crt-unavailable-tests": { "skipImport": true },
109111
"bundle-shading-tests": { "skipImport": true }
110112
},
@@ -145,6 +147,9 @@
145147
"org.junit.jupiter:junit-jupiter": { "packageName": "JUnit5", "packageVersion": "5.x" },
146148
"org.mockito:mockito-core": { "packageName": "Mockito", "packageVersion": "3.x" },
147149
"io.reactivex.rxjava3:rxjava": { "packageName": "RxJava", "packageVersion": "3.x" },
148-
"org.assertj:assertj-core": { "packageName": "AssertJ", "packageVersion": "3.22.x" }
150+
"org.assertj:assertj-core": { "packageName": "AssertJ", "packageVersion": "3.22.x" },
151+
"org.openrewrite:rewrite-java-8": {"packageName": "Maven-org-openrewrite_rewrite-java-8", "packageVersion": "8.x"},
152+
"org.openrewrite:rewrite-java": {"packageName": "Maven-org-openrewrite_rewrite-java", "packageVersion": "8.x"},
153+
"org.openrewrite.recipe:rewrite-java-dependencies": {"packageName": "Maven-org-openrewrite-recipe_rewrite-java-dependencies", "packageVersion": "1.x"}
149154
}
150155
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWS SDK for Java v2 Migration Tool",
4+
"contributor": "",
5+
"description": "Introduce the preview release of the AWS SDK for Java v2 migration tool that automatically migrates applications from the AWS SDK for Java v1 to the AWS SDK for Java v2."
6+
}

build-tools/src/main/resources/software/amazon/awssdk/spotbugs-suppressions.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@
163163
</Not>
164164
</Match>
165165

166+
<!-- Skip the warning since this source is forked from openrewrite -->
167+
<Match>
168+
<Or>
169+
<Class name="software.amazon.awssdk.v2migration.ChangeSdkType"/>
170+
<Class name="software.amazon.awssdk.v2migration.ChangeSdkType$ChangeTypeVisitor"/>
171+
</Or>
172+
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
173+
</Match>
174+
166175
<Match>
167176
<Class name="software.amazon.awssdk.core.internal.waiters.ResponseOrException"/>
168177
<Bug pattern="NM_CLASS_NOT_EXCEPTION"/>
@@ -300,4 +309,10 @@
300309
</Or>
301310
<Bug pattern="SA_FIELD_SELF_ASSIGNMENT"/>
302311
</Match>
312+
313+
<!-- False positive -->
314+
<Match>
315+
<Class name="software.amazon.awssdk.v2migration.EnumCasingToV2$Visitor"/>
316+
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
317+
</Match>
303318
</FindBugsFilter>

buildspecs/release-javadoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ phases:
1818
commands:
1919
- python ./scripts/doc_crosslinks/generate_cross_link_data.py --apiDefinitionsBasePath ./services/ --apiDefinitionsRelativeFilePath src/main/resources/codegen-resources/service-2.json --templateFilePath ./scripts/doc_crosslinks/crosslink_redirect.html --outputFilePath ./scripts/crosslink_redirect.html
2020
- mvn install -P quick -T1C
21-
- mvn clean install javadoc:aggregate -B -Ppublic-javadoc -Dcheckstyle.skip -Dspotbugs.skip -DskipTests -Ddoclint=none -pl '!:protocol-tests,!:protocol-tests-core,!:codegen-generated-classes-test,!:sdk-benchmarks,!:s3-benchmarks,!:module-path-tests,!:test-utils,!:http-client-tests,!:tests-coverage-reporting,!:sdk-native-image-test,!:ruleset-testing-core,!:old-client-version-compatibility-test,!:crt-unavailable-tests,!:bundle-shading-tests'
21+
- mvn clean install javadoc:aggregate -B -Ppublic-javadoc -Dcheckstyle.skip -Dspotbugs.skip -DskipTests -Ddoclint=none -pl '!:protocol-tests,!:protocol-tests-core,!:codegen-generated-classes-test,!:sdk-benchmarks,!:s3-benchmarks,!:module-path-tests,!:test-utils,!:http-client-tests,!:tests-coverage-reporting,!:sdk-native-image-test,!:ruleset-testing-core,!:old-client-version-compatibility-test,!:crt-unavailable-tests,!:bundle-shading-tests,!:v2-migration,!:v2-migration-tests'
2222
- RELEASE_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec`
2323
-
2424
- aws s3 sync target/site/apidocs/ $DOC_PATH/$RELEASE_VERSION/ --acl="public-read"

buildspecs/release-to-maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ phases:
3737
awk 'BEGIN { var=ENVIRON["SDK_SIGNING_GPG_KEYNAME"] } { gsub("\\$SDK_SIGNING_GPG_KEYNAME", var, $0); print }' > \
3838
$SETTINGS_XML
3939
40-
mvn clean deploy -B -s $SETTINGS_XML -Ppublishing -DperformRelease -Dspotbugs.skip -DskipTests -Dcheckstyle.skip -Djapicmp.skip -Ddoclint=none -pl !: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,!:region-testing,!:old-client-version-compatibility-test,!:crt-unavailable-tests,!:bundle-shading-tests -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true
40+
mvn clean deploy -B -s $SETTINGS_XML -Ppublishing -DperformRelease -Dspotbugs.skip -DskipTests -Dcheckstyle.skip -Djapicmp.skip -Ddoclint=none -pl !: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,!:region-testing,!:old-client-version-compatibility-test,!:crt-unavailable-tests,!:bundle-shading-tests,!:v2-migration-tests -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true
4141
else
4242
echo "This version was already released."
4343
fi

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<module>codegen-lite-maven-plugin</module>
7272
<module>archetypes</module>
7373
<module>third-party</module>
74+
<module>v2-migration</module>
7475
<module>test/http-client-tests</module>
7576
<module>test/protocol-tests</module>
7677
<module>test/protocol-tests-core</module>
@@ -88,6 +89,7 @@
8889
<module>test/ruleset-testing-core</module>
8990
<module>test/old-client-version-compatibility-test</module>
9091
<module>test/bundle-logging-bridge-binding-test</module>
92+
<module>test/v2-migration-tests</module>
9193
<module>test/bundle-shading-tests</module>
9294
<module>test/crt-unavailable-tests</module>
9395
</modules>

test/v2-migration-tests/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# AWS SDK Migration Tool Tests
2+
3+
## Description
4+
This module is used to test `v2-migration`. It contains an application that uses the AWS SDK for Java v1
5+
and performs `mvn open:rewrite` to migrate it to the AWS SDK for Java v2 and compares the transformed code
6+
with the expected code for verification. The test code is in [run-test](./src/test/resources/run-test).

test/v2-migration-tests/pom.xml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License").
6+
~ You may not use this file except in compliance with the License.
7+
~ A copy of the License is located at
8+
~
9+
~ http://aws.amazon.com/apache2.0
10+
~
11+
~ or in the "license" file accompanying this file. This file is distributed
12+
~ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13+
~ express or implied. See the License for the specific language governing
14+
~ permissions and limitations under the License.
15+
-->
16+
17+
<project xmlns="http://maven.apache.org/POM/4.0.0"
18+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20+
<modelVersion>4.0.0</modelVersion>
21+
22+
<parent>
23+
<groupId>software.amazon.awssdk</groupId>
24+
<artifactId>aws-sdk-java-pom</artifactId>
25+
<version>2.26.32-SNAPSHOT</version>
26+
<relativePath>../..</relativePath>
27+
</parent>
28+
29+
<groupId>software.amazon.awssdk</groupId>
30+
<artifactId>v2-migration-tests</artifactId>
31+
32+
<dependencyManagement>
33+
<dependencies>
34+
<dependency>
35+
<groupId>com.amazonaws</groupId>
36+
<artifactId>aws-java-sdk-bom</artifactId>
37+
<version>1.11.1000</version>
38+
<type>pom</type>
39+
<scope>import</scope>
40+
</dependency>
41+
</dependencies>
42+
43+
</dependencyManagement>
44+
45+
<dependencies>
46+
<dependency>
47+
<groupId>com.amazonaws</groupId>
48+
<artifactId>aws-java-sdk-core</artifactId>
49+
<scope>test</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>com.amazonaws</groupId>
53+
<artifactId>aws-java-sdk-sqs</artifactId>
54+
<scope>test</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>com.amazonaws</groupId>
58+
<artifactId>aws-java-sdk-s3</artifactId>
59+
<scope>test</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>software.amazon.awssdk</groupId>
63+
<artifactId>s3</artifactId>
64+
<version>${project.version}</version>
65+
<scope>test</scope>
66+
</dependency>
67+
<dependency>
68+
<groupId>software.amazon.awssdk</groupId>
69+
<artifactId>dynamodb</artifactId>
70+
<version>${project.version}</version>
71+
<scope>test</scope>
72+
</dependency>
73+
<dependency>
74+
<groupId>software.amazon.awssdk</groupId>
75+
<artifactId>v2-migration</artifactId>
76+
<version>${project.version}-PREVIEW</version>
77+
<scope>test</scope>
78+
</dependency>
79+
</dependencies>
80+
81+
<build>
82+
<plugins>
83+
<plugin>
84+
<artifactId>exec-maven-plugin</artifactId>
85+
<groupId>org.codehaus.mojo</groupId>
86+
<version>${exec-maven-plugin.version}</version>
87+
<configuration>
88+
<skip>${skip.unit.tests}</skip>
89+
</configuration>
90+
<executions>
91+
<execution>
92+
<id>run-test-script</id>
93+
<phase>test</phase>
94+
<goals>
95+
<goal>exec</goal>
96+
</goals>
97+
<configuration>
98+
<executable>python</executable>
99+
<arguments>
100+
<argument>${basedir}/src/test/resources/run-test</argument>
101+
<argument>-v ${project.version}</argument>
102+
</arguments>
103+
</configuration>
104+
</execution>
105+
</executions>
106+
</plugin>
107+
</plugins>
108+
</build>
109+
110+
111+
</project>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
plugins {
17+
id 'java-library'
18+
}
19+
20+
repositories {
21+
mavenCentral()
22+
mavenLocal()
23+
}
24+
25+
dependencies {
26+
implementation 'software.amazon.awssdk:dynamodb:V2_VERSION'
27+
}
28+
29+
java {
30+
toolchain {
31+
languageVersion = JavaLanguageVersion.of(8)
32+
}
33+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
package gradletest.foo.bar;
17+
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
18+
import software.amazon.awssdk.services.dynamodb.model.CreateTableRequest;
19+
import software.amazon.awssdk.services.dynamodb.model.CreateTableResponse;
20+
21+
public class Library {
22+
public void someMethod() {
23+
DynamoDbClient dynamoDB = DynamoDbClient.builder().build();
24+
CreateTableResponse createTableResult = dynamoDB.createTable(CreateTableRequest.builder().tableName("test")
25+
.build());
26+
System.out.println(createTableResult);
27+
}
28+
}

0 commit comments

Comments
 (0)