As you can see there are two versions of the same artifact in the cache. The only thing that distinguishes them is that they are in different folders with different UUIDs > > tim@tim-laptop ~/.gradle/caches/artifacts-23/filestore/io.vertx/testtools/1.0.0-SNAPSHOT/jar $ ls *
870f8d2ec5509849cb4df93730b502af71d26949:
testtools-1.0.0-SNAPSHOT.jar >
be915b661869ea52d0d0e98bc2c6d506d70c4c3e:
testtools-1.0.0-SNAPSHOT.jar
The UUID is the SHA1 has of the jar file itself, so this indicates that these are actually 2 different artifacts with the same version.
These correspond to different timestamped snapshots pulled from a Maven repo (Nexus). I have verified this by pushing a new snapshot then rebuilding the Gradle project with --refresh-depdendencies. Every time this happens a new entry appears in the cache with a different UUID.
So these snapshots are different binary artifacts, correct? (I assume that the timestamp is encoded within the binary itself).
Gradle maintains these artifacts separately in order to provide repository isolation. So if your project is configured to point at ‘Repository A’, then Gradle will only use the SNAPSHOT version that is available in ‘Repository A’, and will not make newer SNAPSHOTs available if they were downloaded from a different repository.
This repository isolation is different from Maven, but it provides a very important feature to ensure reproducible builds: you will not encounter the situation where a build “works on my machine” due to the presence of an artifact in the Gradle cache.
The downside to this more sophisticated caching mechanism is that the cache itself is more opaque. We have plans to provide a project-specific cache directory that would have a supported, transparent layout, but at this stage the cache layout is considered “private”.
If the ‘idea’ plugin isn’t working for you, an alternative would be to create your own project-level directory containing the jars used by your project, and wire that into your IDE project files instead.