Index of every page on this site: llms.txt
All skills
github avatar

/javax-to-jakarta-migration

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/javax-to-jakarta-migration

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈86 tokens for metadata: the name and description. ≈1.1k when used: this file.

Description uses 4.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈346 characters, or 4.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

javax → jakarta Migration Skill

When to Use

  • The user explicitly asks to migrate to the jakarta namespace, Tomcat 10+/11 or Jakarta EE
  • java-upgrade or spring-boot-4-migration delegates 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 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. 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

  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)

Upstream sources (read before migrating)

Fetch the page for the target version; prefer it over this skill when they conflict.

Output

Provide a migration summary listing all files changed, imports replaced, and any manual steps required.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning13d3 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    The skill is a legitimate utility for migrating Java projects from the javax to the jakarta namespace. It performs standard code and configuration transformations and uses build tools like Maven or Gradle to verify the migration. All external references point to trusted technology documentation and official tools.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: MEDIUM · 1 issue

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated last month
argument-hint
File, package, or module to migrate
  • javax
  • jakarta
  • migration
  • tomcat
  • java-ee
  • servlet
  • persistence
  • gradle
  • maven

README badge

README badge for github/awesome-copilot/javax-to-jakarta-migration

Migrates Java code from javax.* to jakarta.* namespaces, updating imports, Maven dependencies, and XML configuration files. Use when upgrading to Tomcat 11, Jakarta EE 10, or later versions that require the jakarta namespace.

Generated from the current SKILL.md.

Does this handle all javax.* packages?
No. The skill migrates EE-related javax packages (servlet, persistence, validation, etc.) but explicitly skips JDK packages like javax.sql, javax.naming, javax.crypto, and javax.swing, which remain unchanged.
What Java versions and servers does this target?
This skill targets Tomcat 11 and Jakarta EE 10+. It updates dependency versions in pom.xml and web.xml schema namespaces accordingly.
Will this skill update my build file dependencies automatically?
The skill provides the exact dependency coordinate replacements for pom.xml (e.g., javax.servlet:javax.servlet-api to jakarta.servlet:jakarta.servlet-api:6.0.0), but you are responsible for applying them to your build configuration.
Do I need to update web.xml?
Only if your project has a web.xml file. The skill updates the namespace from http://xmlns.jcp.org/xml/ns/javaee to https://jakarta.ee/xml/ns/jakartaee and the version to 6.0.

Generated from the current SKILL.md. These answers refresh after source changes.