Gradle-1.0-milestone-8a doesn't seem to be honoring changingPattern in ivy resolvers

For the benefit of others searching for this issue. Here is what the ultimate solution for me was (thanks lots of help from Daz):

  1. 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 :slight_smile:

Thanks to everyone for all the help, I look forward to the next release.

That code snippet uses an internal DSL that is a work in progress:

  • It’s verbose and not exactly pretty, but this API is used internally for our ‘–offline’ and ‘–refresh’ support. We’ll be improving it post 1.0. - This is an experimental feature and subject to change without notice. We won’t remove or change it without a replacement of some sort, but we won’t give the usual deprecation-first-replace-later guarantee.