Migrate from the AWS SDK for Java v1 to the AWS SDK for Java v2
Apache 2.0This recipe will apply changes required for migrating from the AWS SDK for Java v1 to the AWS SDK for Java v2.
software. amazon. awssdk. v2migration. AwsSdkJavaV1ToV2mod run . --recipe= software. amazon. awssdk. v2migration. AwsSdkJavaV1ToV2Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Add AWS SDK for Java v2 S3 Transfer Manager dependency if needed
- Add AWS SDK for Java v2 S3 Event Notification dependency if needed
- Change v1 Maven/Gradle dependencies to v2
- Add imports and comments to unsupported S3 transforms.
- S3 Event Notification method to v2
- Change S3 types to v2.
- V1 S3Object to V2
- V1 S3 streaming requests to V2
- V1 S3 non-streaming requests to V2
- Change S3 methods to v2.
- Change S3EventNotification methods to v2.
- S3 POJOs to V2
- Change S3 method constructors to fluent builder calls
- Convert v1 AmazonS3URI to v2 S3Uri
- Change v1 enum getters to v2
- Change SDK TransferManager types from v1 to v2
- Change SDK S3EventNotification types from v1 to v2
- Change AWS SDK for Java v1 types to v2 equivalents
- SDK Exceptions Methods to V2
- Change SDK core types from v1 to v2
- V1 client builder variations to builder()
- Change new objects creation to Builder pattern
- Transform 'new' expressions to static factory methods
- V1 Getter to V2
- Move HTTP settings from the ClientOverrideConfiguration to ApacheHttpClient for sync and NettyNioAsyncHttpClient for async
- Wrap the region string provided on the SDK client builder with Region.of
- V1 Enum Casing to V2
- Convert SdkBytes to ByteBuffer
- Convert ByteBuffer to SdkBytes
- Convert Date to Instant
- V1 S3 non-streaming requests to V2
- V1 S3 PutObjectRequest, AmazonS3.putObject(PutObjectRequest), and TransferManager.upload(PutObjectRequest) to V2
- Convert V1 setters to V2 toBuilder setters
- Add imports and comments to unsupported S3 transfer manager transforms.
- Change TransferManager simple methods to v2.
- Transfer Manager Methods to V2