FISH-13694 Add upgrade goal: AI agent for Jakarta EE migration#46
Draft
jGauravGupta wants to merge 1 commit into
Draft
FISH-13694 Add upgrade goal: AI agent for Jakarta EE migration#46jGauravGupta wants to merge 1 commit into
jGauravGupta wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
upgradeMaven goal: runs the Payara Advisor in a loop and uses anAI agent to apply every recommendation to source files, compile, and repeat
PomUpdater: updatesjakarta.jakartaee-apiversion in pom.xmlprogrammatically (before the loop so EE 11 APIs compile cleanly)
BeansXmlCreator: createsbeans.xmldirectly when the advisor flags it missingupgradegoal — AI-powered migrationRuns the advisor, sends each recommendation to an AI agent that rewrites the affected source files, then compiles to verify. Repeats until the advisor reports no remaining issues or the round limit is reached.
Also updates the Jakarta EE dependency version in
pom.xmland createssrc/main/webapp/WEB-INF/beans.xmlwhen required.Prerequisites
Configure the LLM provider via environment variables or system properties:
PAYARA_AI_PROVIDER-Dpayara.ai.providerANTHROPIC,OPEN_AI,GOOGLE,MISTRAL, orOLLAMAPAYARA_AI_API_KEY-Dpayara.ai.api.keyPAYARA_AI_MODEL-Dpayara.ai.modelBasic usage
Migrate to Jakarta EE 11 (default):
Migrate to Jakarta EE 10:
Parameters
advisorVersionpayara.advisor.version2.1-SNAPSHOTtargetJakartaVersionadvisorVersion1110or11. When11, the advisor runs for both EE 10 and EE 11 and setsjakarta.jakartaee-apito11.0.0inpom.xmlmaxRoundspayara.advisor.maxRounds10interactivepayara.ai.interactivefalsetrue, pause before each file write to accept or reject the changeExample with all options
What it does
pom.xmlto the target Jakarta EE version so EE 11 APIs are available on the classpath during the migration.maxRoundsis reached.beans.xmlif the advisor flagged it missing, then does a final compile.A run log is written to
payara-ai-agent.login the project root.Migration paths
EE 9 → EE 10
The advisor detects API-level changes introduced in EE 10 (beyond the
javax.*→jakarta.*namespace rename that was already done in EE 9). UsetargetJakartaVersion=10so the pom.xml is pinned to10.0.0and only the EE 10 advisor runs.EE 9 → EE 11
Run both the EE 10 and EE 11 advisors in one go and land directly on EE 11. This is the default behaviour.
The tool runs the EE 10 advisor first, then the EE 11 advisor, merges the results, and applies all fixes in the same upgrade cycle. The pom.xml is updated to
11.0.0.EE 10 → EE 11
Same command as above — the default
targetJakartaVersion=11runs both advisors and the EE 10 advisor will simply return no findings for a project that is already on EE 10.Summary
upgrade -DadvisorVersion=10upgrade(default)upgrade(default)Depends on:
https://github.com/payara/ecosystem-ai/pull/9