aws-v2
Migrate from AWS SDK for Java v1 (com.amazonaws) to v2 (software.amazon.awssdk). Use when projects need to move away from deprecated AWS SDK v1 to the modern v2 API.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
AWS SDK v2 Migration
Migrate Java projects from AWS SDK v1 (com.amazonaws) to v2 (software.amazon.awssdk).
When to Use
- Project uses deprecated AWS SDK v1 (
com.amazonaws.*imports) - Dependabot/security scans flag v1 vulnerabilities
- Need features only available in v2 (async clients, HTTP/2, etc.)
Skill Contents
Sections
- When to Use (L22-L27)
- Critical: MSK IAM Authentication (L47-L59)
- Migration Strategy (Priority Order) (L60-L68)
- Quick Start (L69-L108)
- References (L109-L114)
- Related Command (L115-L118)
- Related Resources (L119-L122)
Available Resources
📚 references/ - Detailed documentation
Critical: MSK IAM Authentication
When migrating to AWS SDK v2, also update aws-msk-iam-auth if using Kafka with MSK IAM.
Error after migration:
NoClassDefFoundError: com/amazonaws/auth/AWSCredentialsProvider
Fix: Update aws-msk-iam-auth to 2.3.5 (AWS SDK v2 compatible).
See references/migration-patterns.md for details.
Migration Strategy (Priority Order)
| Priority | Strategy | When to Use |
|---|---|---|
| 1 | Update library | A newer version of the library uses v2 |
| 2 | Update BOM | v1 comes from Spring Boot or other BOM |
| 3 | Dependency substitution | Replace v1 artifact with v2 equivalent |
| 4 | Direct code migration | Only if no library update available |
Quick Start
1. Identify v1 Usages
# Find all files with v1 imports
grep -r "import com.amazonaws" --include="*.java" . | grep -v "/build/"
# Check dependency tree
./gradlew dependencies --configuration runtimeClasspath | grep -B5 "com.amazonaws"
2. Apply Migration
See references/migration-patterns.md for detailed code migration patterns.
Dependency Substitution (in root build.gradle):
allprojects {
configurations.configureEach {
resolutionStrategy.dependencySubstitution {
substitute module("com.amazonaws:aws-java-sdk-s3")
using module("software.amazon.awssdk:s3:${libs.versions.aws.sdk.v2.get()}")
because "Migrate to AWS SDK v2"
}
}
}
3. Validate
# Verify no v1 imports remain
grep -r "import com.amazonaws" --include="*.java" . | grep -v "/build/"
# Build and test
./gradlew clean build test
References
| Reference | Content |
|---|---|
| references/migration-patterns.md | Code migration patterns for S3, SQS, SNS, Lambda |
Related Command
This skill is referenced by: /upgrade-to-aws-sdk-v2
Related Resources
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-28
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!