Change Gradle managed dependency

Apache 2.0

Change a Gradle managed dependency coordinates. The newGroupId or newArtifactId MUST be different from before. For now, only Spring Dependency Management Plugin entries are supported and no other forms of managed dependencies (yet).

org.openrewrite.gradle.ChangeManagedDependency

Required

The old groupId to replace. The groupId is the first part of a dependency coordinate 'com.google.guava:guava:VERSION'. Supports glob expressions.

The old artifactId to replace. The artifactId is the second part of a dependency coordinate 'com.google.guava:guava:VERSION'. Supports glob expressions.

Optional

The new groupId to use. Defaults to the existing group id.

The new artifactId to use. Defaults to the existing artifact id.

An exact version number or node-style semver selector used to select the version number. You can also use latest.release for the latest available version and latest.patch if the current version is a valid semantic version. For more details, you can look at the documentation page of version selectors.

Allows version selection to be extended beyond the original Node Semver semantics. So for example,Setting 'version' to "25-29" can be paired with a metadata pattern of "-jre" to select Guava 29.0-jre

mod run . --recipe=org.openrewrite.gradle.ChangeManagedDependency \ -P oldGroupId=org.openrewrite.recipe \ -P oldArtifactId=rewrite-testing-frameworks

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.