Skip to content

Commit

Permalink
Better messaging when no recipe is activated
Browse files Browse the repository at this point in the history
  • Loading branch information
sambsnyd committed Jul 8, 2022
1 parent 455bc7c commit b6ca866
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ protected ResultsContainer listResults() throws MojoExecutionException {
}

Recipe recipe = env.activateRecipes(getActiveRecipes());
if(recipe.getRecipeList().size() == 0) {
getLog().warn("No recipes were activated. " +
"Activate a recipe with <activeRecipes><recipe>com.fully.qualified.RecipeClassName</recipe></activeRecipes> in this plugin's <configuration> in your pom.xml, " +
"or on the command line with -Drewrite.activeRecipes=com.fully.qualified.RecipeClassName");
return new ResultsContainer(baseDir, emptyList());
}

getLog().info("Validating active recipes...");
Collection<Validated> validated = recipe.validateAll();
Expand Down

0 comments on commit b6ca866

Please sign in to comment.