more of a gradle question, but I encountered an an...
# gradle
x
more of a gradle question, but I encountered an annoying issue where dependency versions had changed but the class cache wasn't being invalidated and the source wasn't getting rebuild. I eventually just deleted the whole cache on the CI server and that fixed it. Wondering though if there's a better way to have gradle cache a little less aggressively
g
Do you use dynamic version of dependency? If so, you can change dependency cache lifetime:
Copy code
configurations.all {
    // check for updates every build
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
x
I set that to one minute but even after 5 minutes had passed it didn't seem to help
g
Hm, works for me for snapshot versions
BTW did you apply this config to module with dynamic dependency?
x
yes, and yes I changed the lifetime. ended up writing a full writing here,https://discuss.gradle.org/t/gradle-caching-so-aggressive-its-not-invalidating-source-classes-proprerly/25249