56 results available
Sign in
Skills directory

javax-to-jakarta-migration

github

·

Last changed
Not yet hardened

This version isn't hardened by Chainguard

No hardening report available.


SKILL.md

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:

OldNew

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)

Locate the root <web-app> element and update the namespace URI and version attribute:

<!-- ❌ OLD — recognize this pattern and replace it; do not write this -->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="4.0">

<!-- ✅ NEW — write this instead -->
<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

The agent may perform the following passive verification without shell execution:

  • Search for any remaining javax.* imports in .java files (excluding the JDK-retained packages listed in Step 1)
  • Report any javax. strings found in pom.xml or build.gradle that were not in the migration mapping above

Output

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

Install

Need this version hardened?

Harden your own skills

Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.

Provenance

Upstream source

—

Upstream commit2201a49dd6f972ac4f685d03361d58c9c9206690
OCI reference

—

License

MIT

Files

HARDENING.md

LICENSE

SKILL.md


The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.