I have a custom Ivy-repo published over SMB, HTTP and accessed using a plain directory in the file system for dependencies internal to my company. How that repo is used depends on where a build gets executed, e.g. by some Jenkins sharing the same host like the Ivy-repo or clients of devs and if so, which OS they use etc. Because Gradle is currently unable to publish to plain HTTP-repos because it doesn’t create intermediate directories itself, that repo gets filled using the file-protocol and Windows-clients or by using RSYNC or robocopy or such. So the important point is that files may change at any time.
This really means existing files may change at any time, because we currently don’t work with SNAPSHOT-versions or stuff like that, but instead prefer to simply overwrite existing files in case changes are not (yet) worth it incrementing version numbers of artifacts. Because most of the accesses to the Ivy-repo are NOT done by HTTP, things work as expected most of the time, because Gradle doesn’t cache dependencies at all.
But there are some setups in which Gradle does use HTTP to access that repo, caches its contents and I recently had the problem that updates to those contents were nor properly recognized. This happened when running Jenkins on Windows WITHOUT native/FILE-access to the repo, so the HTTP-fallback has been used. Gradle cached resolved artifacts, ran into build problems because those were not recent enough, I updated the artifacts using Robocopy, but Gradle DID NOT recognize those changes. Instead, I needed to manually delete the cached artifacts to trigger a re-download.
How can I disable caching for some specific HTTP-published Ivy-repo entirely?
What I’ve found so far is the changing-attribute, but the downside of this is that I need to put that in each and every build script using the dependencies. It would be far easier to simply disable caching for one concrete repo at one concrete place only which includes that repo. As Gradle supports multiple different contents for the same artifacts, I would have expected it would be easy to tell it from which source to cache at all, but that doesn’t seem to be the case.