Gradle resolution strategy cacheDynamicVersionsFor isn't working

607 views Asked by At

I want to push Gradle to redownload my SNAPSHOT dependencies every time. It's possible to do it via --refresh-dependencies.
But I want to do it programmatically in a next way:

configurations.all {
    resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
    resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}

dependencies {
    compile(Libraries.staffdetails_biz) { changing = true }
}

(I know that if version is SNAPSHOT, no need to add changing = true, but added it just in case)

So after that, when I'm running my application ./gradlew clean bootRun --info I see the next log:

Downloading https://artifactory.intra.max-it.com/beauty-mvn/jp/co/max/beauty/staffdetails-biz/1.2.0.0-test-SNAPSHOT/maven-metadata.xml to /private/var/folders/1t/yrqc_w552kl_8d5bknxkmfd07bv2xj/T/gradle_download937200563233010269bin
Downloading https://artifactory.intra.max-it.com/beauty-mvn/jp/co/max/beauty/staffdetails-biz/1.2.0.0-test-SNAPSHOT/staffdetails-biz-1.2.0.0-test-SNAPSHOT.pom to /private/var/folders/1t/yrqc_w552kl_8d5bknxkmfd07bv2xj/T/gradle_download778741251330227118bin

And the issue, that it download the pom file, but doesn't download the jar. What should I change in my buildscript to push it to work as expected?


And only If I specify --refresh-dependencies it'll download the jar:

Downloading https://artifactory.intra.max-it.com/beauty-mvn/jp/co/max/beauty/staffdetails-biz/1.2.0.0-test-SNAPSHOT/staffdetails-biz-1.2.0.0-test-SNAPSHOT.jar to /private/var/folders/1t/yrqc_w552kl_8d5bknxkmfd07bv2xj/T/gradle_download1419898241363246448bin
0

There are 0 answers