For the benefit of others searching for this issue. Here is what the ultimate solution for me was (thanks lots of help from Daz):
- Update repository definitions to use the gradle ivy and/or maven DSL in the repositories closure. Don’t use the direct Ivy FileSystem or UrlResolver objects anymore. 2. Continue using the old-style Ivy resolvers for uploading and be sure to set checksums = ‘sha1’ It is very important that checksums are uploaded to avoid extra downloads 3. Add in some code to handle the changing modifier (provided by Daz)
project.configurations.all {
resolutionStrategy {
cacheChangingModulesFor 0, 'seconds'
resolutionRules.with {
eachModule({ moduleResolve ->
if (moduleResolve.request.version.endsWith('-SNAPSHOT')) {
// This will cause the dependency to be refreshed once per build execution
moduleResolve.cacheFor(0, SECONDS)
// This would cause the dependency to be refreshed once per sub-project in a multi-project build. You wouldn't normally want that.
// moduleResolve.refresh()
}
} as Action)
eachArtifact({ artifactResolve ->
if (artifactResolve.request.moduleVersionIdentifier.version.endsWith('-SNAPSHOT')) {
artifactResolve.cacheFor(0, SECONDS)
}
} as Action)
}
}
}
With this setup, the build will check sha1s of any dependencies with versions ending in -SNAPSHOT, if the sha1 has been updated new versions will be downloaded. This is working for me and hopefully we will see sha1 uploading when using the gradle ivy repo DSL in an upcoming version
Thanks to everyone for all the help, I look forward to the next release.