Javax-To-Jakarta-Migration
Javax-To-Jakarta-Migration是一款code方向的AI技能,核心价值是Migrate Java code from javax,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。
Migrate Java code from javax.* to jakarta.* namespace. Use when upgrading to Tomcat 11, Jakarta EE 10, or when javax imports are detected in the codebase.
mkdir -p ./skills/javax-to-jakarta-migration && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/javax-to-jakarta-migration/SKILL.md -o ./skills/javax-to-jakarta-migration/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# javax → jakarta Migration Skill
When to Use
- Upgrading to Tomcat 11 / Jakarta EE 10+
- Code review detects `javax.*` imports
- Migrating an existing project to the jakarta namespace
Procedure
Step 1 — Scan for javax Usage
Search the codebase for all `javax.*` imports that need migration:
javax.servlet.* → jakarta.servlet.*
javax.persistence.* → jakarta.persistence.*
javax.validation.* → jakarta.validation.*
javax.annotation.* → jakarta.annotation.*
javax.inject.* → jakarta.inject.*
javax.enterprise.* → jakarta.enterprise.*
javax.faces.* → jakarta.faces.*
javax.ws.rs.* → jakarta.ws.rs.*
javax.el.* → jakarta.el.*
javax.json.* → jakarta.json.*
javax.mail.* → jakarta.mail.*
javax.websocket.* → jakarta.websocket.***Do NOT migrate** these (they remain in `javax.*`):
- `javax.sql.*` — part of JDK
- `javax.naming.*` — part of JDK (JNDI)
- `javax.crypto.*` — part of JDK
- `javax.net.*` — part of JDK
- `javax.security.auth.*` — part of JDK
- `javax.swing.*`, `javax.xml.parsers.*` — JDK packages
Step 2 — Update pom.xml
Replace dependency coordinates:
| Old | New |
|-----|-----|
| `javax.servlet:javax.servlet-api` | `jakarta.servlet:jakarta.servlet-api:6.0.0` |
| `javax.persistence:javax.persistence-api` | `jakarta.persistence:jakarta.persistence-api:3.1.0` |
| `javax.validation:validation-api` | `jakarta.validation:jakarta.validation-api:3.0.2` |
| `javax.annotation:javax.annotation-api` | `jakarta.annotation:jakarta.annotation-api:2.1.1` |
Step 3 — Update web.xml (if present)
<!-- Old namespace -->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="4.0">
<!-- New namespace -->
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" version="6.0">Step 4 — Update Java Source Files
Replace all `javax.` imports with `jakarta.` equivalents in `.java` files.
Step 5 — Verify
1. Run `mvn clean compile` or `gradlew build` — fix any compilation errors
2. Run `mvn test` or `gradlew test` — ensure all tests pass
3. Search for any remaining `javax.*` imports (excluding JDK packages)
Output
Provide a migration summary listing all files changed, imports replaced, and any manual steps required.
🎯 Best For
- Claude users
- GitHub Copilot users
- Software engineers
- Development teams
- Tech leads
💡 Use Cases
- Code quality improvement
- Best practice enforcement
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Javax-To-Jakarta-Migration to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Is Javax-To-Jakarta-Migration compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Javax-To-Jakarta-Migration?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Javax-To-Jakarta-Migration?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/javax-to-jakarta-migration/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.