Skip to content

Commit 8630245

Browse files
committed
Add README and fix test
1 parent aeb3b25 commit 8630245

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

migration-tool/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# AWS SDK for Java v2 Migration Tool
2+
3+
## Description
4+
This is a migration tool to automate migration from AWS SDK for Java v1 to AWS SDK for Java v2.
5+
It uses [OpenRewrite][open-rewrite].
6+
7+
## Usage
8+
9+
You can use [OpenRewrite Maven plugin][open-rewrite-plugin] to start the migration. See [Running OpenRewrite Recipes][open-rewrite-usage] for more information.
10+
To get started, you can either perform a dry run or run directly.
11+
12+
- Dry Run
13+
14+
With this mode, it generates diff logs in the console as well as diff file in the `target` folder.
15+
Note that you need to replace `{sdkversion}` with the actual SDK version. See [Maven Central][maven-central] to
16+
find the latest version.
17+
18+
```
19+
mvn -U org.openrewrite.maven:rewrite-maven-plugin:dryRun \
20+
-Drewrite.recipeArtifactCoordinates=software.amazon.awssdk:migration-tool:{sdkversion}
21+
-Drewrite.activeRecipes=software.amazon.awssdk.UpgradeJavaSdk2
22+
```
23+
24+
- Run
25+
26+
With this mode, it runs the SDK recipes and applies the changes locally.
27+
28+
```
29+
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
30+
-Drewrite.recipeArtifactCoordinates=software.amazon.awssdk:migration-tool:{sdkversion}
31+
-Drewrite.activeRecipes=software.amazon.awssdk.UpgradeJavaSdk2
32+
```
33+
34+
[open-rewrite]: https://docs.openrewrite.org/
35+
[open-rewrite-usage]: https://docs.openrewrite.org/running-recipes
36+
[open-rewrite-plugin]: https://docs.openrewrite.org/reference/rewrite-maven-plugin
37+
[maven-central]: https://central.sonatype.com/artifact/software.amazon.awssdk/migration-tool

test/migration-tool-tests/src/test/resources/run-test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def run_test(version):
2222
shutil.rmtree(TARGET_DIR)
2323
copy_directory(BEFORE_DIR, TARGET_DIR)
2424

25-
subprocess.run(["mvn", "org.openrewrite.maven:rewrite-maven-plugin:run",
25+
subprocess.run(["mvn", "org.openrewrite.maven:rewrite-maven-plugin:5.21.0:run",
2626
"-Drewrite.recipeArtifactCoordinates=software.amazon.awssdk:migration-tool:"+ version,
2727
"-Drewrite.activeRecipes=software.amazon.awssdk.UpgradeJavaSdk2"], cwd=TARGET_DIR)
2828
shutil.rmtree(os.path.join(TARGET_DIR, "target"))

0 commit comments

Comments
 (0)