Class AbstractRewriteMojo

    • Field Detail

      • project

        @Parameter(defaultValue="${project}",
                   readonly=true,
                   required=true)
        protected org.apache.maven.project.MavenProject project
      • runtime

        @Component
        protected org.apache.maven.rtinfo.RuntimeInformation runtime
      • activeRecipes

        @Parameter(property="activeRecipes")
        protected Set<String> activeRecipes
      • activeStyles

        @Parameter(property="activeStyles")
        protected Set<String> activeStyles
      • suppressWarnings

        protected boolean suppressWarnings
        Maven dependency resolution has a few bugs that lead to the log filling up with (recoverable) errors. While we work on fixing those issues, set this to 'true' during maven parsing to avoid log spam
    • Constructor Detail

      • AbstractRewriteMojo

        public AbstractRewriteMojo()
    • Method Detail

      • environment

        protected org.openrewrite.config.Environment environment()
                                                          throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • executionContext

        protected org.openrewrite.ExecutionContext executionContext()
      • parseMaven

        protected org.openrewrite.maven.tree.Maven parseMaven​(Path baseDir,
                                                              org.openrewrite.ExecutionContext ctx)
      • getBaseDir

        protected Path getBaseDir()
      • listResults

        protected AbstractRewriteMojo.ResultsContainer listResults()
                                                            throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • listJavaSources

        protected static List<Path> listJavaSources​(String sourceDirectory)
                                             throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • logRecipesThatMadeChanges

        protected void logRecipesThatMadeChanges​(org.openrewrite.Result result)
      • getRecipeDescriptor

        public static org.openrewrite.config.RecipeDescriptor getRecipeDescriptor​(String recipe,
                                                                                  Collection<org.openrewrite.config.RecipeDescriptor> recipeDescriptors)
                                                                           throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException