Skip to content

Commit 87afc18

Browse files
authored
Migration Tool GA Release (#6430)
* Merge TransferManager recipes to main recipe (#6392) * Bump OpenRewrite to 3.14.0 (#6394) * Bump OpenRewrite to 3.6.1 * Bump OpenRewrite to 3.14.0 * Remove redundant import add/remove * Add v2 import in S3PojoToV2 * Update unit test for exceptions * Update README and remove "-PREVIEW" from version (#6416) * Update README * Remove -PREVIEW from pom * Add changelog
1 parent d539be0 commit 87afc18

File tree

44 files changed

+370
-497
lines changed

Some content is hidden

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

44 files changed

+370
-497
lines changed
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": "General availability 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+
}

test/v2-migration-tests/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<dependency>
9797
<groupId>software.amazon.awssdk</groupId>
9898
<artifactId>v2-migration</artifactId>
99-
<version>${project.version}-PREVIEW</version>
99+
<version>${project.version}</version>
100100
<scope>test</scope>
101101
</dependency>
102102
<dependency>
@@ -136,6 +136,11 @@
136136
<artifactId>test-utils</artifactId>
137137
<scope>test</scope>
138138
</dependency>
139+
<dependency>
140+
<groupId>commons-io</groupId>
141+
<artifactId>commons-io</artifactId>
142+
<scope>test</scope>
143+
</dependency>
139144
</dependencies>
140145

141146
<build>

test/v2-migration-tests/src/test/java/software/amazon/awssdk/v2migrationtests/GradleProjectTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.junit.jupiter.api.BeforeAll;
3737
import org.junit.jupiter.api.Test;
3838
import org.junit.jupiter.api.condition.EnabledIf;
39-
import software.amazon.awssdk.testutils.SdkVersionUtils;
4039
import software.amazon.awssdk.utils.Logger;
4140

4241
public class GradleProjectTest {
@@ -75,7 +74,7 @@ static void setUp() throws IOException {
7574

7675
Files.setPosixFilePermissions(gradlew, perms);
7776

78-
replaceVersion(gradleActual.resolve("init.gradle"), getMigrationToolVersion() + "-PREVIEW");
77+
replaceVersion(gradleActual.resolve("init.gradle"), getMigrationToolVersion());
7978
}
8079

8180
private static void deleteTempDirectories() throws IOException {

test/v2-migration-tests/src/test/java/software/amazon/awssdk/v2migrationtests/MavenNoCompileTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ static void setUp() throws IOException {
5050
@Test
5151
@EnabledIf("versionAvailable")
5252
void mavenProject_shouldConvert() throws IOException {
53-
boolean experimental = true;
54-
verifyTransformation(experimental);
53+
verifyTransformation();
5554
}
5655
}

test/v2-migration-tests/src/test/java/software/amazon/awssdk/v2migrationtests/MavenProjectTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ static void setUp() throws IOException {
4747
@Test
4848
@EnabledIf("versionAvailable")
4949
void mavenProject_shouldConvert() throws IOException {
50-
boolean experimental = false;
51-
verifyTransformation(experimental);
50+
verifyTransformation();
5251
verifyCompilation();
5352
}
5453
}

test/v2-migration-tests/src/test/java/software/amazon/awssdk/v2migrationtests/MavenTestBase.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,13 @@ protected static void deleteTempDirectories() throws IOException {
4747
FileUtils.deleteDirectory(mavenExpected.toFile());
4848
}
4949

50-
protected static void verifyTransformation(boolean experimental) throws IOException {
50+
protected static void verifyTransformation() throws IOException {
5151
String recipeCmd = "-Drewrite.activeRecipes=software.amazon.awssdk.v2migration.AwsSdkJavaV1ToV2";
52-
if (experimental) {
53-
recipeCmd += "Experimental";
54-
}
55-
5652
List<String> rewriteArgs = new ArrayList<>();
5753
// pin version since updates have broken tests
58-
String rewriteMavenPluginVersion = "5.46.0";
54+
String rewriteMavenPluginVersion = "6.17.0";
5955
addAll(rewriteArgs, "mvn", "org.openrewrite.maven:rewrite-maven-plugin:" + rewriteMavenPluginVersion + ":run",
60-
"-Drewrite.recipeArtifactCoordinates=software.amazon.awssdk:v2-migration:"+ getMigrationToolVersion() + "-PREVIEW",
61-
recipeCmd);
56+
"-Drewrite.recipeArtifactCoordinates=software.amazon.awssdk:v2-migration:"+ getMigrationToolVersion(), recipeCmd);
6257

6358
run(mavenActual, rewriteArgs.toArray(new String[0]));
6459
FileUtils.deleteDirectory(mavenActual.resolve("target").toFile());

test/v2-migration-tests/src/test/java/software/amazon/awssdk/v2migrationtests/MavenTransferManagerTest.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

test/v2-migration-tests/src/test/resources/software/amazon/awssdk/v2migrationtests/gradle/before/init.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ initscript {
33
maven { url "https://plugins.gradle.org/m2" }
44
}
55
dependencies {
6-
classpath("org.openrewrite:plugin:6.28.0")
6+
classpath("org.openrewrite:plugin:7.15.0")
77
}
88
}
99

test/v2-migration-tests/src/test/resources/software/amazon/awssdk/v2migrationtests/maven-nocompile/after/src/main/java/foo/bar/S3EnDateTime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class S3EnDateTime {
2525
public void parseEvent(String jsonInput) {
2626
S3EventNotification notification = S3EventNotification.fromJson(jsonInput);
2727

28-
for (S3EventNotification.S3EventNotificationRecord record : notification.getRecords()) {
28+
for (S3EventNotificationRecord record : notification.getRecords()) {
2929
DateTime eventTime = /*AWS SDK for Java v2 migration: getEventTime returns Instant instead of DateTime in v2. AWS SDK v2 does not include org.joda.time as a dependency. If you want to keep using DateTime, you'll need to manually add "org.joda.time:joda-time" dependency to your project after migration.*/new DateTime(record.getEventTime().toEpochMilli());
3030

3131
GlacierEventData glacierEventData = record.getGlacierEventData();

test/v2-migration-tests/src/test/resources/software/amazon/awssdk/v2migrationtests/maven-tm/after/pom.xml

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)