Snapshot dependencies are not updated sometimes

With milestone 7 my snapshot dependencies have not been updated a couple of times when running gradle. However, this only happens sometimes and I have not found a stable way to reproduce. After deleting the gradle cache, the updated artifacts are downloaded. I’m running against a nexus repository.

I noticed that gradle uploads artifacts UTC/GMT timezone (UTC/GMT) while we are one hour ahead. However, on download gradle seems to use the local timezone to compare times which makes gradle believe in certain situations that a jar has not been updated.

Example: - Project A depends on Project B ( A->B ) - Local timezone: UTC + 1h - gradle dependencies is executed on project A at 10:05 UTC (11:05 local time). A new snapshot gets fetched. - gradle uploadArchives is executed on project B at 10:30 UTC, a new snapshot is uploaded with the timestamp 10:30 - At 11:35 UTC (11:35 local time) gradle dependencies is invoked on project A. Gradle compares the local timestamp of the last downloaded artifact (11:05 local time) with the UTC timestamp of the newest artifact (10:30) in this case. Gradle thinks that it has already downloaded the latest artifact which is wrong.

Can you confirm this?

Reposted from the mailing list: http://gradle.1045684.n5.nabble.com/Snapshot-dependencies-are-not-updated-sometimes-td5431444.html

There is a known issue with Milestone 7 and snapshot artifacts: http://wiki.gradle.org/display/GRADLE/Gradle+1.0-milestone-7+Migration+Guide#Gradle1.0-milestone-7MigrationGuide-Mavensnapshotartifactsnotupdated.

Please see the linked forum post for a suggested workaround. You can also try the latest nightly, where this has been fixed.