Class AbstractRewriteBaseRunMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractRewriteDryRunMojo, AbstractRewriteRunMojo

public abstract class AbstractRewriteBaseRunMojo extends AbstractRewriteMojo
  • Field Details

    • exportDatatables

      @Parameter(property="rewrite.exportDatatables", defaultValue="false") protected boolean exportDatatables
    • options

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

      @Parameter(property="rewrite.recipeChangeLogLevel", defaultValue="WARN") protected LogLevel recipeChangeLogLevel
      The level used to log changes performed by recipes.
  • Constructor Details

    • AbstractRewriteBaseRunMojo

      public AbstractRewriteBaseRunMojo()
  • Method Details

    • log

      protected void log(LogLevel logLevel, CharSequence content)
    • repositoryRoot

      protected Path repositoryRoot()
      Attempt to determine the root of the git repository for the given project. Many Gradle builds co-locate the build root with the git repository root, but that is not required. If no git repository can be located in any folder containing the build, the build root will be returned.
    • listResults

      protected AbstractRewriteBaseRunMojo.ResultsContainer listResults(org.openrewrite.ExecutionContext ctx) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • loadSourceSet

      protected org.openrewrite.LargeSourceSet loadSourceSet(Path repositoryRoot, org.openrewrite.config.Environment env, org.openrewrite.ExecutionContext ctx) throws org.apache.maven.artifact.DependencyResolutionRequiredException, org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.artifact.DependencyResolutionRequiredException
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • runRecipe

      protected List<org.openrewrite.Result> runRecipe(org.openrewrite.Recipe recipe, org.openrewrite.LargeSourceSet sourceSet, org.openrewrite.ExecutionContext ctx)
    • logRecipesThatMadeChanges

      protected void logRecipesThatMadeChanges(org.openrewrite.Result result)
    • estimateTimeSavedSum

      protected Duration estimateTimeSavedSum(org.openrewrite.Result result, Duration timeSaving)
    • formatDuration

      protected String formatDuration(Duration duration)