javax-to-jakarta-migration
यह क्या करती है
यह टूल आपके Java कोड में पुराने packages (javax.*) को नए packages (jakarta.*) से बदलकर उसे अपडेट करता है। Tomcat वेब सर्वर या Jakarta EE framework जैसी तकनीकों के नए versions इस्तेमाल करने के लिए यह ज़रूरी है।
कब इस्तेमाल करें
- ✓जब आप Tomcat 10+ या Jakarta EE इस्तेमाल करना चाहते हों।
- ✓जब कोई Java या Spring Boot upgrade tool यह migration सुझाए।
- ✓जब आप साफ़ तौर पर 'javax' से 'jakarta' में migrate करने को कहें।
Skill का लिंक
https://github.com/github/awesome-copilot/blob/main/skills/javax-to-jakarta-migration/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे Java कोड को Jakarta EE namespace इस्तेमाल करने के लिए अपडेट करो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
टूल आपकी code फ़ाइलों और configurations में 'javax.*' packages को ढूँढकर 'jakarta.*' से बदलता है। यह आपके project की dependencies को भी सही Jakarta EE versions पर अपडेट करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
javax → jakarta Migration Skill
When to Use
- The user explicitly asks to migrate to the jakarta namespace, Tomcat 10+/11 or Jakarta EE
java-upgradeorspring-boot-4-migrationdelegates the namespace migration
Detecting javax.* imports alone does not authorize this migration; report them instead.
In Spring Boot projects, the Boot BOM manages Jakarta versions: do not pin the versions below, and let the Boot version decide the Jakarta EE level (Boot 4 = Jakarta EE 11, Servlet 6.1). The examples below target Jakarta EE 10 (Servlet 6.0, Tomcat 10.1+) in non-Boot projects.
Procedure
Step 0 — Baseline
Run ./mvnw verify or ./gradlew build first and record the result; do not migrate on a red baseline. Make the change in a dedicated commit/step.
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 JDKjavax.naming.*— part of JDK (JNDI)javax.crypto.*— part of JDKjavax.net.*— part of JDKjavax.security.auth.*— part of JDKjavax.swing.*,javax.xml.parsers.*— JDK packages
Step 2 — Update pom.xml
Replace dependency coordinates. Choose API versions that match the target runtime; the table below is for Jakarta EE 10 (Tomcat 10.1+, Servlet 6.0):
| Target runtime | Jakarta EE | Servlet | Persistence | Validation | Annotations |
|---|---|---|---|---|---|
| Tomcat 10.0 | 9 | 5.0 | 3.0 | 3.0 | 2.0 |
| Tomcat 10.1 | 10 | 6.0 | 3.1 | 3.0 | 2.1 |
| Tomcat 11 | 11 | 6.1 | 3.2 | 3.1 | 3.0 |
| 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)
The version must match the target Servlet level (5.0 for Tomcat 10.0, 6.0 for Tomcat 10.1, 6.1 for Tomcat 11); the example below is for Servlet 6.0:
<!-- 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 only the Jakarta EE javax. imports identified in Step 1 with their jakarta. equivalents in .java files; leave JDK packages (for example javax.sql, javax.crypto) unchanged. Also check non-Java references: persistence.xml (javax.persistence.* properties), META-INF/services, beans.xml, properties/YAML, string class names and reflection.
Step 5 — Verify
- Run
mvn clean compileorgradlew build— fix any compilation errors - Run
mvn testorgradlew test— ensure all tests pass - Search for any remaining
javax.*imports (excluding JDK packages)
Upstream sources (read before migrating)
Fetch the page for the target version; prefer it over this skill when they conflict.
- Jakarta EE specifications: https://jakarta.ee/specifications/
- Eclipse Transformer (binary/bytecode transformation): https://github.com/eclipse-transformer/transformer
- OpenRewrite
org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta: https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxmigrationtojakarta - Tomcat 9 to 10 migration: https://tomcat.apache.org/migration-10.html
- Hibernate migration guides: https://hibernate.org/orm/documentation/migrate/
- Spring Boot 3 upgrade (Jakarta EE 9+ baseline): https://docs.spring.io/spring-boot/upgrading.html
Output
Provide a migration summary listing all files changed, imports replaced, and any manual steps required.
अक्सर पूछे जाने वाले सवाल
कौन से 'javax.*' packages migrate नहीं किए जाने चाहिए?
JDK (Java Development Kit) का हिस्सा बने packages, जैसे javax.sql.*, javax.naming.*, javax.crypto.*, javax.net.*, javax.security.auth.*, javax.swing.* और javax.xml.parsers.*, migrate नहीं करने चाहिए।
'javax' और 'jakarta' namespaces क्या हैं?
ये Java libraries के समूहों के अलग-अलग नाम हैं। 'Jakarta' इसका नया रूप है, जो नए servers और frameworks के versions में इस्तेमाल होता है।
इस टूल को इस्तेमाल करने से पहले क्या मुझे कुछ करना होगा?
हाँ, सब कुछ सही चल रहा है यह पक्का करने के लिए migration से पहले और बाद में अपने project का build command (जैसे './mvnw verify' या './gradlew build') चलाने की सलाह दी जाती है।
जानकारी
लेखक का मूल विवरण
Migrate Java code from javax.* to jakarta.* namespace. Use only when the user explicitly asks for a javax to jakarta namespace or framework migration (for example to Tomcat 10+/11 or Jakarta EE), or when java-upgrade or spring-boot-4-migration delegates it. Finding javax imports alone does not authorize a migration.
repo: github/awesome-copilot
लोकप्रियता
- GitHub स्टार
- 40k
- रैंकिंग में स्थान
- #7263
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
acquire-codebase-knowledge
40kआपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।
acreadiness-assess
40kआपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।
acreadiness-generate-instructions
40kआपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।
acreadiness-policy
40kआपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।