← All recipes
Open source

Remove Maven plugin goal

Recipe IDorg.openrewrite.maven.RemovePluginGoalArtifactorg.openrewrite:rewrite-maven

Removes a goal from a Maven plugin wherever it is declared: directly under a <plugin>, inside <executions>, and within <build>, <pluginManagement>, or <profiles>. If removing the goal leaves an <execution> with no remaining goals, the execution is removed. If all executions are removed, the <executions> element is also removed.

Single recipeApache 2.0

Usage

You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.maven.RemovePluginGoal --recipe-option "pluginGroupId=org.apache.maven.plugins" --recipe-option "pluginArtifactId=maven-compiler-plugin" --recipe-option "goal=compile"

If the recipe isn’t available locally, install it with:

mod config recipes jar install org.openrewrite:rewrite-maven:RELEASE

Options

NameTypeDescription
pluginGroupIdrequiredStringGroup ID of the plugin from which the goal will be removed. Supports glob. A Group ID is the first part of a plugin coordinate 'org.apache.maven.plugins:maven-compiler-plugin:VERSION'.
e.g. org.apache.maven.plugins
pluginArtifactIdrequiredStringArtifact ID of the plugin from which the goal will be removed. Supports glob. The second part of a plugin coordinate 'org.apache.maven.plugins:maven-compiler-plugin:VERSION'.
e.g. maven-compiler-plugin
goalrequiredStringThe goal to remove. Matching is case-insensitive and supports glob.
e.g. compile

Data tables

Structured output this recipe can produce.

  • Source files that had resultsSource files that were modified by the recipe run.org.openrewrite.table.SourcesFileResults
  • Source files that had search resultsSearch results that were found during the recipe run.org.openrewrite.table.SearchResults
  • Source files that errored on a recipeThe details of all errors produced by a recipe run.org.openrewrite.table.SourcesFileErrors
  • Recipe performanceStatistics used in analyzing the performance of recipes.org.openrewrite.table.RecipeRunStats