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,RewriteDiffMojo,RewriteDiscoverMojo,RewriteFixMojo,RewriteWarnMojo
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 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 Instance Methods Concrete Methods Modifier and Type Method Description protected org.openrewrite.config.Environmentenvironment()protected org.openrewrite.ExecutionContextexecutionContext()protected PathgetBaseDir()protected org.openrewrite.Parser.Listenerlistener()protected 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
-
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()
-
listener
protected org.openrewrite.Parser.Listener listener()
-
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 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)
-
-