Upgrade Gradle dependency versions

Apache 2.0

Upgrade the version of a dependency in a build.gradle file. Supports updating dependency declarations of various forms:

  • String notation: "group:artifact:version"
  • Map notation: group: 'group', name: 'artifact', version: 'version' Can update version numbers which are defined earlier in the same file in variable declarations, and in a version catalog.
org.openrewrite.gradle.UpgradeDependencyVersion

Required

The first part of a dependency coordinate com.google.guava:guava:VERSION. This can be a glob expression.

The second part of a dependency coordinate com.google.guava:guava:VERSION. This can be a glob expression.

Optional

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. Defaults to latest.release.

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

mod run . --recipe=org.openrewrite.gradle.UpgradeDependencyVersion \ -P groupId='com.fasterxml.jackson*' \ -P artifactId='jackson-module*'

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