Add Managed Maven plugin
Recipe ID
org.openrewrite.maven.AddManagedPluginArtifact
org.openrewrite:rewrite-mavenAdd the specified Maven plugin to the Plugin Managed of the pom.xml.
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.0Options
| Name | Type | Description |
|---|---|---|
groupIdrequired | String | The first part of a dependency coordinate 'org.openrewrite.maven:rewrite-maven-plugin:VERSION'. e.g. org.openrewrite.maven |
artifactIdrequired | String | The second part of a dependency coordinate 'org.openrewrite.maven:rewrite-maven-plugin:VERSION'. e.g. rewrite-maven-plugin |
version | String | A fixed version of the plugin to add. e.g. 1.0.0 |
configuration | String | Optional plugin configuration provided as raw XML e.g. <configuration><foo>foo</foo></configuration> |
dependencies | String | Optional 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> |
executions | String | Optional executions provided as raw XML. e.g. <executions><execution><phase>generate-sources</phase><goals><goal>add-source</goal></goals></execution></executions> |
filePattern | String | A 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