Pass in single recipe configuration options on the command line#816
Pass in single recipe configuration options on the command line#816timtebeek merged 10 commits intoopenrewrite:mainfrom
Conversation
|
Thanks for getting this started! Would you happen to have an example of how the non-flat Map is assigned from the command line? I'm wondering how to test this properly. We'll likely start with incubating this, and potentially have to limit it to non-composite recipes, as larger composites can contain a single recipe multiple times, and not all recipes might have the same options. Right now it seems like we might set the same argument on all recipes? |
|
From command line it wouldn't be possible, as maven don't parse complex types from command line. Those can only be set as maven configuration on pom file |
timtebeek
left a comment
There was a problem hiding this comment.
Nice to see this kicked off ; I've added two comments that I think we should address before a merge, but I'm also interested to hear your thoughts. Mostly I want to add this in such a way that we promote good practices, and not enable anti-patterns too much.
|
This now works. mvn org.openrewrite.maven:rewrite-maven-plugin:5.36.0-SNAPSHOT:run -Drewrite.activeRecipes=org.openrewrite.maven.RemovePlugin -Drewrite.options=groupId=org.springframework.boot,artifactId=spring-boot-maven-pluginWhen run against the spring-petclinic it correctly removes only the argument plugin; Thanks to all involved! |
|
This is awesome... I'm still shocked that maven can parse lists but can't maps |
* Do not wrap single active recipe & remove `activateAll()` As discovered on openrewrite/rewrite-maven-plugin#816 * Add missing recipe descriptions * Do not expect CompositeRecipe wrapper in data table row * Return Recipe.noop() when there are no activated recipes * Add missing test descriptions * Further test fixes
|
Thanks again @velo ! Hope this helps folks to do quick one-off configurable recipe runs. |
Use like this: