Skip to content

Replace aws-java-sdk-core dependency #5347

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ recipeList:
groupId: software.amazon.awssdk
artifactId: netty-nio-client
version: 2.23.16-SNAPSHOT
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: com.amazonaws
oldArtifactId: aws-java-sdk-core
newGroupId: software.amazon.awssdk
newArtifactId: aws-core
newVersion: 2.23.16-SNAPSHOT

- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
oldGroupId: com.amazonaws
oldArtifactId: aws-java-sdk-bom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ def add_dependencies(f, version):
version: {0}'''
f.write(add_dependencies_str.format(version))

def replace_core_dependencies(f, version):
add_dependencies_str = '''
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
oldGroupId: com.amazonaws
oldArtifactId: aws-java-sdk-core
newGroupId: software.amazon.awssdk
newArtifactId: aws-core
newVersion: {0}
'''
f.write(add_dependencies_str.format(version))

def write_cloudwatch_recipe(f, version):
change_bom = '''
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
Expand All @@ -88,6 +99,7 @@ def write_recipe_yml_file(service_mapping):
write_copy_right_header(f)
write_recipe_metadata(f, version)
add_dependencies(f, version)
replace_core_dependencies(f, version)
write_bom_recipe(f, version)
for s in service_mapping:
# edge case : v1 contains modules: cloudwatch AND cloudwatchmetrics, which both map to cloudwatch in v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,33 +75,43 @@ void standardClient_shouldChangeDependencyGroupIdAndArtifactId() throws IOExcept
+ " <dependencies>\n"
+ " <dependency>\n"
+ " <groupId>com.amazonaws</groupId>\n"
+ " <artifactId>aws-java-sdk-core</artifactId>\n"
+ " <version>1.12.100</version>\n"
+ " </dependency>\n"
+ " <dependency>\n"
+ " <groupId>com.amazonaws</groupId>\n"
+ " <artifactId>aws-java-sdk-sqs</artifactId>\n"
+ " <version>1.12.100</version>\n"
+ " </dependency>\n"
+ " </dependencies>\n"
+ " </project>",
String.format(" <project>\n"
+ " <groupId>com.test.app</groupId>\n"
+ " <artifactId>my-app</artifactId>\n"
+ " <version>1</version>\n"
+ " <dependencies>\n"
+ " <dependency>\n"
+ " <groupId>software.amazon.awssdk</groupId>\n"
+ " <artifactId>sqs</artifactId>\n"
+ " <version>%1$s</version>\n"
+ " </dependency>\n"
+ " <dependency>\n"
+ " <groupId>software.amazon.awssdk</groupId>\n"
+ " <artifactId>apache-client</artifactId>\n"
+ " <version>%1$s</version>\n"
+ " </dependency>\n"
+ " <dependency>\n"
+ " <groupId>software.amazon.awssdk</groupId>\n"
+ " <artifactId>netty-nio-client</artifactId>\n"
+ " <version>%1$s</version>\n"
+ " </dependency>\n"
+ " </dependencies>\n"
+ " </project>", currentVersion)
String.format("<project>\n"
+ " <groupId>com.test.app</groupId>\n"
+ " <artifactId>my-app</artifactId>\n"
+ " <version>1</version>\n"
+ " <dependencies>\n"
+ " <dependency>\n"
+ " <groupId>software.amazon.awssdk</groupId>\n"
+ " <artifactId>aws-core</artifactId>\n"
+ " <version>2.23.16-SNAPSHOT</version>\n"
+ " </dependency>\n"
+ " <dependency>\n"
+ " <groupId>software.amazon.awssdk</groupId>\n"
+ " <artifactId>sqs</artifactId>\n"
+ " <version>2.23.16-SNAPSHOT</version>\n"
+ " </dependency>\n"
+ " <dependency>\n"
+ " <groupId>software.amazon.awssdk</groupId>\n"
+ " <artifactId>apache-client</artifactId>\n"
+ " <version>2.23.16-SNAPSHOT</version>\n"
+ " </dependency>\n"
+ " <dependency>\n"
+ " <groupId>software.amazon.awssdk</groupId>\n"
+ " <artifactId>netty-nio-client</artifactId>\n"
+ " <version>2.23.16-SNAPSHOT</version>\n"
+ " </dependency>\n"
+ " </dependencies>\n"
+ "</project>", currentVersion)

)
);
Expand Down
Loading