-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WINDUP-3128: mta-cli script openrewrite #76
WINDUP-3128: mta-cli script openrewrite #76
Conversation
…ophy/windup-distribution into CLI_SCRIPT_OPENREWRITE
@m-brophy My testing went very well I tested he recipes against the spring-petclinic-migration project and all of the import javax.* /spring-petclinic-migration/src/main/java/org/springframework/samples/petclinic/system/CacheConfig.java:import javax.cache.configuration.Configuration; |
@PhilipCattanach Those packages were never officially accepted into java EE, they were part of JSR107 I suppose we could just leave them as they are, not being part of Java EE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-brophy one initial "blocker" to be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-brophy one initial "blocker" to be fixed.
…into CLI_SCRIPT_OPENREWRITE
I have repeated my tests after rebuilding to include the latest commit and everything worked perfectly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Fedora and MacOS and it worked fine 👍
Thanks a lot @m-brophy
windows behaviour for setting configlocation is different to linux
…prevent errors with non-git source trees
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully tested on Windows 11 and RHEL CSB
https://issues.redhat.com/browse/WINDUP-3128
this needs this rulesets PR to work: windup/windup-rulesets#570
an openrewrite migration can now be called from the mta-cli script using this format of command:
./mta-cli --openrewrite "-DactiveRecipes=org.jboss.windup.JavaxToJakarta" --input /home/mbrophy/Projects/spring-petclinic-migration --goal dryRun
Argument details:
--openrewrite
this is a flag specifying to run an openrewrite migration rather than an MTA analysis. The two cannot be run together simultaneously, it must be one or the other."-DactiveRecipes=org.jboss.windup.JavaxToJakarta"
This tells openrewrite which recipe to apply to the input project. JavaxtoJakarta is the default shipped recipe but a user can add their own to the shipped rewrite.yml and run that recipe instead if they so choose. The shipped rewrite.yml file is located in therules/openrewrite/
folder in the unzipped MTA distribution.--input
this is the path to the source project which the openrewrite migration is to be performed upon.--goal
this is the openrewrite maven goal to run. This argument is optional, if not supplied the script will run thedryRun
goal which reports on the changes and creates a patch file which can be applied later. To apply the recipe changes immediately without this stage, therun
goal can be supplied as this argument instead.