← All recipes
Open source

Add Managed Maven plugin

Recipe IDorg.openrewrite.maven.AddManagedPlugin
Artifactorg.openrewrite:rewrite-maven

Add the specified Maven plugin to the Plugin Managed of the pom.xml.

Single recipeApache 2.0

Usage

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

mod run . --recipe org.openrewrite.maven.AddManagedPlugin --recipe-option "groupId=org.openrewrite.maven" --recipe-option "artifactId=rewrite-maven-plugin"

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

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

Options

NameTypeDescription
groupIdrequiredStringThe first part of a dependency coordinate 'org.openrewrite.maven:rewrite-maven-plugin:VERSION'.
e.g. org.openrewrite.maven
artifactIdrequiredStringThe second part of a dependency coordinate 'org.openrewrite.maven:rewrite-maven-plugin:VERSION'.
e.g. rewrite-maven-plugin
versionStringA fixed version of the plugin to add.
e.g. 1.0.0
configurationStringOptional plugin configuration provided as raw XML
e.g. <configuration><foo>foo</foo></configuration>
dependenciesStringOptional plugin dependencies provided as raw XML.
e.g. <dependencies><dependency><groupId>com.yourorg</groupId><artifactId>core-lib</artifactId><version>1.0.0</version></dependency></dependencies>
executionsStringOptional executions provided as raw XML.
e.g. <executions><execution><phase>generate-sources</phase><goals><goal>add-source</goal></goals></execution></executions>
filePatternStringA glob expression that can be used to constrain which directories or source files should be searched. Multiple patterns may be specified, separated by a semicolon ;. If multiple patterns are supplied any of the patterns matching will be interpreted as a match. When not set, all source files are searched.
e.g. **/*-parent/grpc-*/pom.xml

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