Migrate Gradle project dependencies to version catalog
MSALMigrates Gradle project dependencies to use the version catalog feature. Supports migrating dependency declarations of various forms:
Stringnotation:"group:artifact:version"Mapnotation:group: 'group', name: 'artifact', version: 'version'- Property references:
"group:artifact:$version"or"group:artifact:${version}"
The recipe will:
- Create a
gradle/libs.versions.tomlfile with version declarations - Replace dependency declarations with catalog references (e.g.,
libs.springCore) - Migrate version properties from
gradle.propertiesto the version catalog - Preserve project dependencies unchanged
Note: If a version catalog already exists, the recipe will not modify it.
org. openrewrite. gradle. migrate. artifacts. MigrateDependenciesToVersionCatalogmod run . --recipe= org. openrewrite. gradle. migrate. artifacts. MigrateDependenciesToVersionCatalogInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.