Closed scottmarlow closed 2 months ago
https://www.linkedin.com/pulse/how-build-megazord-making-godfather-java-tests-young-again-daniel-sshgf/ has some related context with regard to the ^ effort.
Hi @scottmarlow and welcome to the project! Happy to help you with this migration; feel free to drop into our Slack if you want a more synchronous way to reach me.
Had a brief look, at it appears you've configured AddArquillianDeployMethod
as your active recipe, but looking at the implementation that extends JavaIsoVisitor, instead of org.openrewrite.Recipe
.
AddArquillianDeployMethod<ExecutionContext> extends JavaIsoVisitor<ExecutionContext>
You'll likely want to create a recipe that returns that visitor instead, and configure that for your recipe runs. Let me know if you'd like more guidance than just that feedback, and I'll see what I can fit in.
Glad to see you're using OpenRewrite already; if you'd like we can also deploy your recipes to app.moderne.io, such that you can run them at scale more easily; likely something that'll help once you're further along. Our Moderne CLI and IntelliJ might also help you iterate more quickly in recipe development; happy to get you up to speed on all of those.
Separately had a brief look on of we can provide a more helpful error message when a recipe is not found, but it's instead a non-recipe class as was the case here. The relevant code is here: https://github.com/openrewrite/rewrite/blob/d5071a5f0fda751f6a5f4f075c6dedfd81776410/rewrite-core/src/main/java/org/openrewrite/config/Environment.java#L136-L155
The challenge there is the listRecipes
calls through to a ResourceLoader
interface that abstracts over the various ways recipes can be loaded from classpath & yaml files, both in OSS Maven/Gradle plugins and the Moderne platform & CLI. That means it's not easy to detect that a class might be found, but is not of the correct type.
I'm hoping this type of issue is rare, and that recent updates to the docs and providing a rewrite-recipe-starter would prevent this type of issue in the future.
In any case I'll gladly get you up and running with an openrewrite/rewrite-jakartaee module if that helps all of us collaborate on recipes, and deploy those to the Moderne platform. We already support running recipes on some 38 Jakarta EE repositories there, and can help you track progress towards goals through our DevCenter: https://app.moderne.io/devcenter/Jakarta%20EE
With that I think we can close this issue, although I'll monitor any responses to build out this collaboration.
I'm hoping this type of issue is rare, and that recent updates to the docs and providing a rewrite-recipe-starter would prevent this type of issue in the future.
+1
In any case I'll gladly get you up and running with an openrewrite/rewrite-jakartaee module if that helps all of us collaborate on recipes, and deploy those to the Moderne platform. We already support running recipes on some 38 Jakarta EE repositories there, and can help you track progress towards goals through our DevCenter: https://app.moderne.io/devcenter/Jakarta%20EE
I'm just now reading your comments from a few months ago on https://www.linkedin.com/pulse/how-build-megazord-making-godfather-java-tests-young-again-daniel-sshgf about ^ and looked at the jakartaee recipes on the Moderne which look great for user applications. Those jakartaee recipes should be repeatably useful, however we are looking to do a one time (automated) rewrite of the Jakarta EE Platform TCK tests in the https://github.com/jakartaee/platform-tck/tree/tckrefactor branch. We have already switched from Apache Ant to building with Apache Maven but still need to switch from the Java Test Harness (predates JUnit framework). This topic probably deserves a Slack thread discussion, so I will start one there.
Please advise how I can gain insight into why the
Recipes not found
is thrown for a recipe that is contained in an artifact specified as arewrite-maven-plugin
configuration dependency.So far, I tried setting a debugger breakpoint in org.openrewrite.config.Environment#activateRecipes which didn't seem to process the
tck.jakarta.platform:tck-rewrite-tools:1.0-SNAPSHOT
dependency that is included in therewrite-maven-plugin
configuration. Could this be caused by a missing dependency/class not found issue? Or something else?This is a work in progress effort to refactor the Jakarta EE 11 Platform TCK tests via the https://github.com/jakartaee/platform-tck/tree/tckrefactor which we would like to complete in 2024.
I am using:
I am using the Maven plugin in a module that is part of a multi-module project.
Can you share your configuration so that we can rule out any configuration issues?
Please see https://github.com/scottmarlow/jakartaee-tck/blob/rewritejpa/jpa/pom.xml#L137
What is the smallest, simplest way to reproduce the problem?
I will update this to include the needed steps.
What is the full stack trace of any errors you encountered?
Are you interested in contributing a fix to OpenRewrite?