Closed hosepbell closed 1 year ago
Hi @hosepbell ; Thanks for reporting this issue here! it was also reported over on https://github.com/openrewrite/rewrite-migrate-java/issues/231 , and we're hoping to have this fixed with https://github.com/openrewrite/rewrite-migrate-java/pull/230 . That last one is waiting for review and merge, so hope to have this in shortly.
Thank you so much Timtebeek! I appreciate the quick response. Will be looking forward for the new merge :)
I've gone ahead and merged the potential fix; you should be able to try it out through our snapshot versions shortly; You'll want to use the latest snapshot for rewrite-migrate-java specifically. Let me know if that works for you!
Thank you for your response. I am wondering if there's any one way to use the latest snapshot using the maven command line. I am trying to keep my pom.xml file unchanged and just applying the maven command line through git bash to perform the necessary upgrades?
Hi @hosepbell ; You might be able to use our snapshot versions without changing your build by adding our snapshot repository to your global maven settings in ~/.m2/settings.xml
, and then running:
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:LATEST \
-Drewrite.activeRecipes=org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7
Notice how I'm using -U
to get the latest plugin, and and LATEST
to get the latest snapshot, whereas the documentation uses RELEASE
to get stable releases.
I've not tried any of this yet, but it ought to work; and otherwise the new releases are just around the corner. Does that answer your question?
I will wait for the new releases as I am still having problems with Java8Parser. I added the snapshot versions to my settings.xml and also used the command you provided but unfortunately it did not work. Thank you again for your help, I am looking forward for the new releases coming soon!
Hello,
I was using the OpenRewrite SpringBoot update recipes and they where working fine. Recently, some changes have been committed to the recipes, specifically the Java8Parser as well as other files. I have attempted to use the older version of the recipe (such as 4.9.0) but although this version does not give errors, it also does not perform any changes to the pom or the rest of the files. This is the command I am running: mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE -Drewrite.activeRecipes=org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7
which gives the error : Caused by: java.lang.IllegalStateException: Unable to construct Java8Parser. Caused by: java.lang.NoSuchFieldError: ANNOTATION_PROCESSOR_MODULE_PATH
When reusing the same recipe but inputting rewrite-maven-plugin:4.9.0:run instead, it runs successfully without errors but does not perform any update to the Pom.xml.
Please note that I have attempted to delete the m2 repo and performed a mvn clean install after the rewrite command to insure the package builds correctly.