Plugin Documentation

This report describes goals, parameters details, requirements and sample usage of this plugin.

Goals

Goals available for this plugin:

Goal Description
rewrite:discover Generate a report of the available recipes and styles found on the classpath.

Can also be used to display information about a specific recipe. For example:
./mvnw rewrite:discover -Ddetail=true -Drecipe=org.openrewrite.java.format.AutoFormat
rewrite:dryRun Generate warnings to the console for any recipe that would make changes, but do not make changes.

This variant of rewrite:dryRun will fork the maven life cycle and can be run as a "stand-alone" goal. It will execute the maven build up to the process-test-classes phase.

rewrite:dryRunNoFork Generate warnings to the console for any recipe that would make changes, but do not make changes.

This variant of rewrite:dryRun will not fork the maven life cycle and can be used (along with other goals) without triggering repeated life-cycle events. It will execute the maven build up to the process-test-classes phase.

rewrite:help Display help information on rewrite-maven-plugin.
Call mvn rewrite:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
rewrite:run Run the configured recipes and apply the changes locally.

This variant of rewrite:run will fork the maven life cycle and can be run as a "stand-alone" goal. It will execute the maven build up to the process-test-classes phase.

rewrite:runNoFork Run the configured recipes and apply the changes locally.

This variant of rewrite:run will not fork the maven life cycle and can be used (along with other goals) without triggering repeated life-cycle events.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.3.1
JDK 8

System Requirements History

The following specifies the minimum requirements to run this Maven plugin for historical versions:

Plugin Version Maven JDK
from 5.4.0 to 5.45.0 3.3.1 8
from 1.0.0 to 5.3.2 - 8

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.openrewrite.maven</groupId>
          <artifactId>rewrite-maven-plugin</artifactId>
          <version>5.46.0-SNAPSHOT</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.openrewrite.maven</groupId>
        <artifactId>rewrite-maven-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"