To use it, build the project:
mvn clean install
Select a project containing as fully qualified name dev.snowdrop.demo.FooBar
package dev.snowdrop.demo;
class FooBar {
}
and execute the command:
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=dev.snowdrop:openrewrite-rules:1.0-SNAPSHOT \
-Drewrite.activeRecipes=org.openrewrite.java.SayHelloToFooBarRecipe
When done, check if openrewrite added a Hello method
package dev.snowdrop.demo;
class FooBar {
public String hello() {
return "Hello from dev.snowdrop.demo.FooBar!";
}
}
mvnDebug -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.recipeArtifactCoordinates=dev.snowdrop:openrewrite-rules:1.0-SNAPSHOT \
-Drewrite.activeRecipes=org.openrewrite.FindParseFailures,org.openrewrite.java.search.FindMissingTypes,org.openrewrite.java.SayHelloToFooBarRecipe \
-Drewrite.exportDatatables=true