mvn fish.payara.tools:payara-platform-migration-tool:<version>:migrate
Getting Started
Obtaining the Tool
The tool is a single jar that you can run in four ways:
| Way | Best for | How to start |
|---|---|---|
Maven plugin |
Maven projects, scripts and CI |
|
Java jar |
Gradle, Ant or any project without a |
|
Web UI |
Choosing settings in your browser and watching live progress |
|
Claude Code (MCP) |
Letting Claude Code read the findings and make the edits |
All four ways use the same advisors and the same settings.
|
Tip
|
To use a shorter Maven command, add fish.payara.tools to pluginGroups in your Maven settings.xml. Then mvn payara-platform-migration-tool:start works without the group id and version.
|
Start with the Web UI
Go to the root of your project and start the settings page. It runs on your machine only.
mvn fish.payara.tools:payara-platform-migration-tool:<version>:start
Your browser opens a page where you choose:
-
Project: the folder to migrate, the Jakarta EE version (10 or 11) and the Payara version. Leave the version fields empty to detect them.
-
What to run:
-
Detection only: shows which technologies your project uses and changes nothing.
-
Advisors + recipes (default): scans, then applies the automatic fixes. No AI is used and no tokens are spent.
-
AI agent: does the above, then lets an AI agent work through the findings that need judgement.
-
-
The advisors to run, and optionally the file types to scan.
Click Start to see live progress. The page also shows the command it runs, which you can copy to use in scripts or CI.
Analyze Your Project (No AI)
Go to the root of your project and run:
mvn fish.payara.tools:payara-platform-migration-tool:<version>:migrate \
-Dmigration.dir=. \
-Dmigration.advisor=true
This runs the advisors, applies the automatic fixes (recipes) and writes a report. To only report what would change without editing any file, add -Dmigration.apply=false. To only detect which technologies your project uses, use -Dmigration.detection=true.
Upgrade Your Project with the AI Agent
-
Commit your project to version control, or work on a branch, so you can review and revert the changes. By default the tool also commits after each step, which requires a clean git repository.
-
Configure your LLM provider. For example, with environment variables:
export PAYARA_AI_PROVIDER=OPEN_AI export PAYARA_AI_API_KEY=<your API key>See Supported Providers for the values.
-
Run the migration with the agent enabled:
mvn fish.payara.tools:payara-platform-migration-tool:<version>:migrate \ -Dmigration.dir=. \ -Dmigration.advisor=true \ -Dmigration.agent=true -
Review the changes and the report, and run your own tests.
By default, the tool upgrades to Jakarta EE 11. To upgrade to Jakarta EE 10, add -Dmigration.target=10.
|
Warning
|
With the agent enabled, the tool modifies your source files and sends source code to your configured LLM provider. |
Using the jar without Maven
The jar has the same commands as the Maven goals: start, migrate, view and help. Settings are passed as --migration.<name>=<value> instead of -Dmigration.<name>=<value>. A command is always required.
java -jar payara-platform-migration-tool-<version>.jar migrate \
--migration.dir=/path/to/your-app \
--migration.advisor=true
The AI provider settings are not migration.* settings. With the jar, set them as environment variables, or as -D properties placed before -jar.
Supported Providers
| Provider | Value of PAYARA_AI_PROVIDER |
Notes |
|---|---|---|
Claude Code CLI |
|
No key needed. Uses your logged-in |
Anthropic (Claude) |
|
Needs |
OpenAI |
|
Needs |
Google (Gemini) |
|
Needs |
Mistral |
|
Needs |
Ollama (local) |
|
No key. Set |
Custom OpenAI-compatible endpoint |
|
Needs |
These variables configure the provider. With Maven, set them as environment variables or as -D flags.
| Variable | Default | Meaning |
|---|---|---|
|
none |
The provider to use. Required when the agent is on. |
|
the provider’s default |
Model name, for example |
|
none |
API key. Not needed for |
|
none |
Base URL. Required for |
|
|
Seconds to wait for one request. |
|
the model’s default |
Sampling temperature. |
|
the model’s default |
Most output tokens per request. |
|
|
Log every prompt sent to the model. |
|
|
Log every answer received. |
For guidance on which provider and model to use, see Choosing an LLM.
Interactive Mode
To review each file change before it is written, enable interactive mode. The tool asks for a yes or no in the terminal before the agent writes a file. This needs an interactive terminal.
mvn fish.payara.tools:payara-platform-migration-tool:<version>:migrate \
-Dmigration.advisor=true -Dmigration.agent=true \
-Dmigration.agent.interactive=true
Using the Tool from Claude Code
The jar can also run as an MCP server. Claude Code can then ask the tool what your project needs, run the automatic recipes, apply the recommended fixes with its own tools, and check that the project still builds. No AI provider settings are needed, because Claude Code does the AI work.
Go to your project and add the server:
cd /path/to/your-app
claude mcp add payara-platform-migration-tool -- java -jar /path/to/payara-platform-migration-tool-<version>.jar mcp
To add it for every project, add --scope user. To let it work only inside certain folders, add --allowed-roots=/path/one,/path/two after mcp.
Start Claude Code after adding the server, and type /mcp to check that it shows as connected. A session that is already running does not pick up a new server.
Then ask Claude Code, in this order:
-
Check what is there: "Use the payara-platform-migration-tool tools to detect what this project contains, then scan it and summarise the findings."
-
Do the migration: "Use the migrate_project prompt from payara-platform-migration-tool for this project. Run the recipes first and show me the preview before you apply it, then rescan and compile to confirm."
-
Check the result: "Rescan and tell me how many findings are fixed, how many are new and how many remain. Then compile the project."
Claude Code asks your permission before it calls the tools that change files (run_recipes, apply_guided_recipes) or run your build (compile, test). The server does not make git commits, so commit or branch first and review the result with git diff.
|
Tip
|
The first scan of a large project can take a few minutes. Raise Claude Code’s tool timeout for it (MCP_TOOL_TIMEOUT).
|
Gradle and Other Projects
The tool compiles your project with its own build tool: Maven (using mvnw if present), Gradle or Ant. Run it as the jar, which does not need a pom.xml. Dependency changes are written for Maven pom.xml files only. For Gradle projects, source and descriptor findings are handled, but dependency changes are partly manual.
For Gradle and Ant projects, use the standalone jar command:
java -jar payara-platform-migration-tool-<version>.jar migrate \
--migration.dir=/path/to/your-app \
--migration.advisor=true
Stopping a Run
Use the Stop button on the live report page. The run ends at the next safe point, never in the middle of an edit, and every change made so far stays on disk. The report is written and marked STOPPED. A stop is not a failed build: the Maven goal ends with a warning and the jar exits with code 130.
Parameter Reference
The same migration.* settings work in both forms. Maven takes them as -Dmigration.dir=…, the jar as --migration.dir=…. A jar flag without a value means true. Run the help goal (or java -jar … help) to print the same list from the tool.
| Setting | Values | Default | Meaning |
|---|---|---|---|
|
folder |
the folder you run in |
Root of the project to migrate. |
|
|
|
Jakarta EE version to migrate to. |
|
|
derived from the Jakarta EE target |
Payara major version to migrate to. |
|
|
|
|
| Setting | Values | Default | Meaning |
|---|---|---|---|
|
|
|
Report which advisors apply, then stop. Cannot be combined with the next two. |
|
|
|
Run the advisors, build the plan and apply the recipes. |
|
|
|
Also run the AI agent on the findings the recipes cannot fix. Uses an AI provider and costs tokens. |
| Setting | Values | Default | Meaning |
|---|---|---|---|
|
comma list |
all |
Only run these advisors, for example |
|
comma list |
all files |
Only scan these file types, for example |
|
comma list |
none |
Skip these file types. Ignored when an include list is set. |
| Setting | Values | Default | Meaning |
|---|---|---|---|
|
number, at least 1 |
|
How many times the agent re-scans and retries unresolved findings. |
|
number, at least 0 |
|
Extra rounds to fix compile errors left after the agent rounds. |
|
|
|
The agent also acts on informational findings. |
|
number, at least 1 |
|
Most files in one prompt. |
|
number, at least 0 |
|
Stop a round after this many batches. |
|
file |
none |
An existing |
|
|
|
Ask yes or no in the terminal before the agent writes a file. |
| Setting | Values | Default | Meaning |
|---|---|---|---|
|
|
|
Open the live-updating report in your browser during the run. |
|
|
|
Commit after each recipe pass and each agent round. Needs a clean git repository (no staged or unstaged changes). |
|
|
|
Also copy the final report to |
|
|
|
Add timing lines to the log. |