Change Maven dependency exclusion
Recipe ID
org.openrewrite.maven.ChangeExclusionArtifact
org.openrewrite:rewrite-mavenModify Maven dependency exclusions, changing the group ID, artifact Id, or both. Useful when an excluded dependency has been renamed and references to it must be updated.
Usage
You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.maven.ChangeExclusion --recipe-option "oldGroupId=org.springframework" --recipe-option "oldArtifactId=spring-web*"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 |
|---|---|---|
oldGroupIdrequired | String | The old groupId to replace. Supports glob expressions. e.g. org.springframework |
oldArtifactIdrequired | String | The old artifactId to replace. Supports glob expressions. e.g. spring-web* |
newGroupId | String | The new groupId to use. Defaults to the existing group id. e.g. org.springframework.boot |
newArtifactId | String | The new artifactId to use. Defaults to the existing artifact id. e.g. spring-boot-starter-web |
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