Snapshots are Not Updated

(my accounts) #1


snapshots are not updated:

project A:
        project B:
 depends on "0.0.1-BUILD-SNAPSHOT"

Whenever the “project A” is updated and uploaded to the repo ( via uploadArchives { repositories.mavenDeployer … } ), “project B” does not pick up a “fresh” 0.0.1.BUILD-SNAPSHOT version of the “project A”, but rather uses the one in a cache. says to be fixed, but the issue is still there.


This is certainly working in Milestone-8, and I’d be surprised if it regressed in the build you are using.

By default, SNAPSHOT dependencies are cached and updated once every 24 hours. If you require a SNAPSHOT dependency to be updated on every build, you can do:

configurations.all {
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'

Check out the user guide for more info.

(my accounts) #3


Is it suppose to update ALL dependencies on every build (if set to 0), or just SNAPSHOTs?

Thank you.


When using a maven repository, modules with a version ending in “SNAPSHOT” are considered to be ‘changing modules’. Other modules are not.

It’s worth reading the Dependency Management chapter of the user guide to get a better understanding of how these things work.

(my accounts) #5


I can see Gradle pulling in SNAPSHOTs properly from command line now.

However, when I try to update IDEA with “gradle clean ideaModule”, the SNAPSHOT is not updated in the cache.

I have:

idea.project.ipr.beforeMerged {
    module ->

But it does not help.

Thank you.

(my accounts) #6

Taking it back. I figured out what is going on.

SNAPSHOTs are properly updated. It’s


that are NOT. Hence in IDEA, unless I run tests, I see no changes to the file. Any way Gradle can update “BUILD-SNAPSHOT” and “BUILD-SNAPSHOT-sources”?

Thank you.


There’s not really a way to do this at this time. As a one-off, try running Gradle with ‘–refresh=dependencies’. This will update all of the cached dependencies.

Gradle is smart about this, and will only download the dependencies if they have changed, based on published *.sha1 files.

(my accounts) #8

I see. That seems to work, although is taking some time to checksum all the SHA1…

gradle -ai --refresh=dependencies ideaModule

Thank you Daz.

(cwocwo1) #9

–refresh dependencies is so slow. Is there any good way?


There is another way, using an experimental and subject-to-change cache control DSL: check out Sean’s ultimate response to