Home > Enterprise >  How to know if there's a dependency update using Gradle Version Catalog
How to know if there's a dependency update using Gradle Version Catalog

Time:10-06

My project is using now Version Catalog for all the Gradle modules, and now using the type safe declaration of dependencies in the build.gradle file I don't get any suggestions from the IDE when there's an update of a specific dependency.

What would be the best approach to know if there's an update of a dependency, instead of checking manually one by one?

CodePudding user response:

After some research, I found a solution. Let's say we have an implementation named xyz, and we want to update it whenever we sync our files with gradle (if a newer version is available).

dependencies {
   implementation 'com.something.xyz: '
}

And I think it should do the job. The plus sign will look for the latest version whenever you will sync your files.

CodePudding user response:

My recommendation is to use the gradle-versions-plugin or this extension of it (https://plugins.gradle.org/plugin/se.ascp.gradle.gradle-versions-filter). Both add an additional gradle task dependencyUpdates to your project that will tell you which version updates are available.

Also works fine in combination with the new versions catalog feature you mentioned. I am using it too.

  • Related