Remove redundant explicit dependencies
Apache 2.0Remove explicit dependencies that are already provided transitively by a specified dependency. This recipe downloads and resolves the parent dependency's POM to determine its true transitive dependencies, allowing it to detect redundancies even when both dependencies are explicitly declared. A direct dependency is only removed when the transitive one provides it at the exact same scope and with the same declared exclusions, so that removing it does not change the effective classpath. Declarations that constrain resolution through a version range or dynamic version, such as a Gradle version { strictly ... } block, are never removed.
org. openrewrite. java. dependencies. RemoveRedundantDependenciesRequired
The first part of a dependency coordinate com.google.guava:guava:VERSION of the parent dependency. This can be a glob expression.
The second part of a dependency coordinate com.google.guava:guava:VERSION of the parent dependency. This can be a glob expression.
mod run . --recipe= org. openrewrite. java. dependencies. RemoveRedundantDependencies \
-P groupId= com. fasterxml. jackson. core \
-P artifactId= jackson-databindInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.