Package org.openrewrite.maven
Class AbstractRewriteMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.openrewrite.maven.AbstractRewriteMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CycloneDxBomMojo,RewriteDiscoverMojo,RewriteDryRunMojo,RewriteRunMojo
public abstract class AbstractRewriteMojo extends org.apache.maven.plugin.AbstractMojo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractRewriteMojo.ResultsContainer
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>activeRecipesprotected Set<String>activeStylesprotected org.apache.maven.project.MavenProjectprojectprotected org.apache.maven.rtinfo.RuntimeInformationruntimeprotected booleansuppressWarningsMaven dependency resolution has a few bugs that lead to the log filling up with (recoverable) errors.
-
Constructor Summary
Constructors Constructor Description AbstractRewriteMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.openrewrite.config.Environmentenvironment()protected org.openrewrite.ExecutionContextexecutionContext()protected PathgetBaseDir()static org.openrewrite.config.RecipeDescriptorgetRecipeDescriptor(String recipe, Collection<org.openrewrite.config.RecipeDescriptor> recipeDescriptors)protected static List<Path>listJavaSources(String sourceDirectory)protected AbstractRewriteMojo.ResultsContainerlistResults()protected voidlogRecipesThatMadeChanges(org.openrewrite.Result result)protected org.openrewrite.maven.tree.MavenparseMaven(Path baseDir, org.openrewrite.ExecutionContext ctx)-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
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
-
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
-
-
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
-
-