refreshVersions icon indicating copy to clipboard operation
refreshVersions copied to clipboard

Support plugin versions in version catalog

Open reva opened this issue 1 year ago • 1 comments

I'm probably missing something, but just following the docs...:

🐛 Describe the problem

  • Plugin versions in gradle/libs.versions.toml do not get 'refreshed'
  • VersionCatalogOnly still needs a versions.properties file

⚠️ Current behavior

  • When migrating with VersionCatalogOnly the versions.properties is still required
  • When running refreshVersions, the versions for plugins in the gradle/libs.versions.toml do not get comments for the newest versions

✅ Expected behavior

  • VersionCatalogOnly should only use the version catalog, not the version.properties
  • refreshVersions should refresh plugins as well. It does so in the versions.properties but this file is not expected at all (#640)

💣 Steps to reproduce

  • Create a new gradle/kotlin project, e.g.: https://start.spring.io/#!type=gradle-project-kotlin&language=kotlin&platformVersion=3.0.4&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=configuration-processor,devtools,native
  • Add the refresh versions plugin to the settings.gradle.kts file
  • Run ./gradlew refreshVersionsMigrate --mode=VersionCatalogOnly
  • Run ./gradlew refreshVersions
  • 🛑 In gradle/libs.versions.toml, the versions of plugins are not refreshed
  • 🛑 When deleting the versions.properties file, the build fails (Plugin [id: 'org.springframework.boot'] was not found in any of the following sources)

reva avatar Mar 14 '23 12:03 reva

Testing a bit further it seemed to me that the plugin always used the versions.properties file, not the actual version catalog. I curated the libs.versions.toml file by hand and switched to version-catalog-update-plugin which works great but for https://github.com/gradle/gradle/issues/22797 (which should soon be fixed)

reva avatar Mar 17 '23 18:03 reva