Skip to main content
skill GitHub Copilot official · GitHub

javax-to-jakarta-migration — GitHub Copilot skill

Migrates Java code from the javax.* namespace to jakarta.*. Use it for an explicit Jakarta EE or Tomcat 10+/11 migration request.

Install into GitHub Copilot · Skills CLI (Vercel) All methods and platforms ↓
npx skills add github/awesome-copilot --skill javax-to-jakarta-migration
Open on GitHub

What javax-to-jakarta-migration does

The skill finds Jakarta EE imports and changes javax.* references to jakarta.*. It updates dependency coordinates in pom.xml and, when present, aligns the web.xml namespace and Servlet version with the target runtime.

It starts with ./mvnw verify or ./gradlew build and stops when the baseline build fails. It then checks .java files, persistence.xml, META-INF/services, beans.xml, YAML, properties, string class names, and reflection. Compilation, tests, and a final import scan follow the edits.

JDK packages such as javax.sql, javax.crypto, and javax.naming stay unchanged. In Spring Boot projects, the Boot BOM selects Jakarta versions, so dependencies should not pin them. Install this skill when a namespace migration is already intended; finding javax.* imports alone is not enough.

What it helps with

  • replace javax.servlet.* imports with jakarta.servlet.*
  • update Jakarta dependency coordinates in pom.xml
  • align web.xml with the target Servlet version
  • check configuration and string references to javax.*
  • find remaining imports after migration

Example prompts for the agent

  • Migrate the `web-app` module from `javax.*` to `jakarta.*` for Tomcat 10.1.
  • Update `pom.xml` and `web.xml` for a Tomcat 11 migration.
  • Check `src/main/java` and replace Jakarta EE imports only.

How to install javax-to-jakarta-migration

1Skills CLI (Vercel)

npx skills add github/awesome-copilot --skill javax-to-jakarta-migration

2GitHub CLI

gh skill install github/awesome-copilot javax-to-jakarta-migration

3Manually: put the files in place

.github/skills/javax-to-jakarta-migration/SKILL.md

From the same set554

The whole set →
git-commit official github This skill reviews Git changes, stages related files, and creates Conventional Commits. Use it when you want an agent to make one commit or split work into separate commits. GitHub Copilot 47,165installs excalidraw-diagram-generator official github Turn a plain-language description into an Excalidraw diagram. Useful for mapping processes, system structure, and relationships between entities. GitHub Copilot 31,639installs multi-stage-dockerfile official github This skill guides GitHub Copilot in writing multi-stage Dockerfiles for different languages and frameworks. Use it when the final runtime image should contain fewer build dependencies. GitHub Copilot 29,688installs documentation-writer official github Skill that turns the agent into a technical writer following the Diátaxis framework: tutorials, how-to guides, reference, and explanation. Proposes structure before writing. GitHub Copilot 27,757installs prd official github Turns a feature idea into a structured PRD with user stories, technical requirements, and risks. Use it when planning a software feature or an AI-powered one. GitHub Copilot 24,035installs refactor official github This skill reshapes existing code without changing its external behavior. Use it for gradual cleanup of large functions, duplication, weak types, and code smells. GitHub Copilot 22,321installs java-springboot official github Gives GitHub Copilot Spring Boot development practices, from project layout to tests and security. Use it when writing or reviewing Java application code. GitHub Copilot 21,272installs create-readme official github This skill reviews a project and creates a structured README.md. Use it when the repository needs clear documentation based on its actual files and code. GitHub Copilot 19,081installs

Similar

bigquery-udfs official google Builds, deploys, and debugs BigQuery UDFs and Remote Functions using SQL, JavaScript, Python, or Cloud Run. Useful when running custom code directly inside BigQuery queries. Claude Code Gemini CLI CX Codex 81installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs google-agents-cli-adk-code official Google A reference skill for building ADK agents with tools, callbacks, state, and workflows. Use it when an agent project needs concrete API patterns or code examples. Claude Code CX Codex Cursor +1 511,400installs lark-im larksuite This skill lets an agent work with Lark IM messages, chats, files, and interactive cards. Use it when coding tasks need access to team conversations. Claude Code CX Codex Cursor +1 472,300installs lark-event larksuite Listens to Lark/Feishu events and streams them as NDJSON. Use it for bots, message processing, and long-running subscribers. Claude Code CX Codex Cursor +1 466,200installs caveman-discover JuliusBrussee Finds and labels every LLM workflow in your repository so Caveman Cloud breaks down spend by actual job rather than grouping everything into one bucket. Claude Code CX Codex Cursor +1 103,500installs migration JuliusBrussee Enforces reversible, compatibility-safe transitions for schema, data, and API updates. Useful whenever data loss or rollout downtime is unacceptable. Claude Code CX Codex Cursor +1 102,900installs

Questions about javax-to-jakarta-migration

How do I install javax-to-jakarta-migration in GitHub Copilot?

Run npx skills add github/awesome-copilot --skill javax-to-jakarta-migration. You can also use gh skill install github/awesome-copilot javax-to-jakarta-migration.

What does javax-to-jakarta-migration do?

The skill migrates a Java project from javax.* to jakarta.*, covering imports, dependencies, web.xml, and related configuration references. It then runs build, test, and remaining-import checks.

When should I avoid running this migration?

Do not run it solely because javax.* imports were found. It is intended for an explicit Jakarta EE or Tomcat 10+/11 migration, or when java-upgrade or spring-boot-4-migration delegates the work.

Source text

SKILL.md · MIT
---
name: javax-to-jakarta-migration
description: '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.'
argument-hint: "File, package, or module to migrate"
---

# 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:
```xml
<!-- 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.

- 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.

© github · MIT · github/awesome-copilot

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor