Version Catalog and module cache

Hi,

i created a versionCatalog and published it in a jar file on a nexus. Now i added the catalog to my other projects via settings.gradle like this:

dependencyResolutionManagement {
repositories {
maven {url “${nexusUrl}/plugins/”}
}
versionCatalogs {
libs {
from("…:versionCatalog:+")
}
}
}

Everything works well until a change something in the catalog. Now i have to delete the gradle module cache to see the change. What can i do?

Did you try to run with --refresh-dependencies?
Resolution results are cached for some time by default.

Yes --refresh-dependencies works but only on command line. Since i run the tasks via IDE i have to type this everytime manually. Is there a way to configure an equivalent in the configuration files?

You could configure how long to cache the resoultion result for the dynamic version as documented at Gradle User Manual: Version 7.2.

But maybe it would make more sense to instead use a composite build while you are working on the dependency, then it is always automatically rebuilt if necessary and always the latest state used.

And as a third alternative, at least if your ide is intellij, you should also be able to configure that it always uses --refresh-dependencies by default for new Gradle run configurations by editing the defaults.