Package org.openrewrite.maven
Class AbstractRewriteMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.openrewrite.maven.ConfigurableRewriteMojo
-
- org.openrewrite.maven.AbstractRewriteMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractRewriteDryRunMojo,AbstractRewriteRunMojo,ConfigureMojo,CycloneDxBomMojo,InitMojo,RemoveMojo,RewriteDiscoverMojo
public abstract class AbstractRewriteMojo extends ConfigurableRewriteMojo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractRewriteMojo.ResultsContainer
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.maven.execution.MavenSessionmavenSessionprotected org.apache.maven.project.MavenProjectprojectprotected org.apache.maven.repository.RepositorySystemrepositorySystemprotected org.apache.maven.rtinfo.RuntimeInformationruntimeprotected org.apache.maven.settings.crypto.SettingsDecryptersettingsDecrypter-
Fields inherited from class org.openrewrite.maven.ConfigurableRewriteMojo
checkstyleConfigFile, failOnInvalidActiveRecipes, metricsPassword, metricsUri, metricsUsername, pomCacheDirectory, pomCacheEnabled, runPerSubmodule, sizeThresholdMb, skipMavenParsing
-
-
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()protected URLClassLoadergetRecipeClassloader()static org.openrewrite.config.RecipeDescriptorgetRecipeDescriptor(String recipe, Collection<org.openrewrite.config.RecipeDescriptor> recipeDescriptors)protected AbstractRewriteMojo.ResultsContainerlistResults()protected voidlogRecipesThatMadeChanges(org.openrewrite.Result result)-
Methods inherited from class org.openrewrite.maven.ConfigurableRewriteMojo
getActiveRecipes, getActiveStyles, getExclusions, getRecipeArtifactCoordinates
-
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
-
settingsDecrypter
@Component protected org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter
-
repositorySystem
@Component protected org.apache.maven.repository.RepositorySystem repositorySystem
-
mavenSession
@Parameter(defaultValue="${session}", readonly=true) protected org.apache.maven.execution.MavenSession mavenSession
-
-
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()
-
getBaseDir
protected Path getBaseDir()
-
listResults
protected AbstractRewriteMojo.ResultsContainer listResults() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getRecipeClassloader
protected URLClassLoader getRecipeClassloader() 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
-
-