Class ConfigurableRewriteMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.openrewrite.maven.ConfigurableRewriteMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractRewriteMojo

public abstract class ConfigurableRewriteMojo extends org.apache.maven.plugin.AbstractMojo
  • Field Details

    • configLocation

      @Parameter(property="rewrite.configLocation", alias="configLocation", defaultValue="${maven.multiModuleProjectDirectory}/rewrite.yml") protected String configLocation
    • activeRecipes

      @Nullable @Parameter(property="rewrite.activeRecipes") protected @Nullable LinkedHashSet<String> activeRecipes
    • activeStyles

      @Nullable @Parameter(property="rewrite.activeStyles") protected @Nullable LinkedHashSet<String> activeStyles
    • metricsUri

      @Nullable @Parameter(property="rewrite.metricsUri", alias="metricsUri") protected @Nullable String metricsUri
    • metricsUsername

      @Nullable @Parameter(property="rewrite.metricsUsername", alias="metricsUsername") protected @Nullable String metricsUsername
    • metricsPassword

      @Nullable @Parameter(property="rewrite.metricsPassword", alias="metricsPassword") protected @Nullable String metricsPassword
    • pomCacheEnabled

      @Parameter(property="rewrite.pomCacheEnabled", alias="pomCacheEnabled", defaultValue="true") protected boolean pomCacheEnabled
    • pomCacheDirectory

      @Nullable @Parameter(property="rewrite.pomCacheDirectory", alias="pomCacheDirectory") protected @Nullable String pomCacheDirectory
    • rewriteSkip

      @Parameter(property="rewrite.skip", defaultValue="false") protected boolean rewriteSkip
    • skipMavenParsing

      @Parameter(property="skipMavenParsing", defaultValue="false") protected boolean skipMavenParsing
      When enabled, skip parsing Maven `pom.xml`s, and any transitive poms, as source files. This can be an efficiency improvement in certain situations.
    • checkstyleConfigFile

      @Nullable @Parameter(property="rewrite.checkstyleConfigFile", alias="checkstyleConfigFile") protected @Nullable String checkstyleConfigFile
    • checkstyleDetectionEnabled

      @Nullable @Parameter(property="rewrite.checkstyleDetectionEnabled", alias="checkstyleDetectionEnabled", defaultValue="true") protected @org.openrewrite.internal.lang.Nullable boolean checkstyleDetectionEnabled
    • sizeThresholdMb

      @Nullable @Parameter(property="sizeThresholdMb", defaultValue="10") protected @org.openrewrite.internal.lang.Nullable int sizeThresholdMb
    • failOnInvalidActiveRecipes

      @Parameter(property="rewrite.failOnInvalidActiveRecipes", alias="failOnInvalidActiveRecipes", defaultValue="false") protected boolean failOnInvalidActiveRecipes
      Whether to throw an exception if an activeRecipe fails configuration validation. This may happen if the activeRecipe is improperly configured, or any downstream recipes are improperly configured.

      For the time, this default is "false" to prevent one improperly recipe from failing the build. In the future, this default may be changed to "true" to be more restrictive.

    • runPerSubmodule

      @Parameter(property="rewrite.runPerSubmodule", alias="runPerSubmodule", defaultValue="false") protected boolean runPerSubmodule
    • mavenSession

      @Parameter(defaultValue="${session}", readonly=true) protected org.apache.maven.execution.MavenSession mavenSession
    • pluginDescriptor

      @Parameter(defaultValue="${plugin}", required=true, readonly=true) protected org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor
  • Constructor Details

    • ConfigurableRewriteMojo

      public ConfigurableRewriteMojo()
  • Method Details

    • getExclusions

      protected Set<String> getExclusions()
    • getPlainTextMasks

      protected Set<String> getPlainTextMasks()
    • putState

      protected void putState(ConfigurableRewriteMojo.State state)
    • allProjectsMarked

      protected boolean allProjectsMarked()
    • getActiveRecipes

      protected Set<String> getActiveRecipes()
    • getActiveStyles

      protected Set<String> getActiveStyles()
    • loadStyles

      protected List<org.openrewrite.style.NamedStyles> loadStyles(org.apache.maven.project.MavenProject project, org.openrewrite.config.Environment env)
    • getRecipeArtifactCoordinates

      protected Set<String> getRecipeArtifactCoordinates()