Gradle How can i specify the cacheResolutionStrategy for the SNAPSHOT version in my buildscript block? -
i having problems resolutionstrategy.cachechangingmodulesfor.
my project build.gradle looks similar this
apply plugin: 'base' apply plugin: 'maven' apply plugin: 'maven-publish' apply from: "gradle/mixins/cachestrategy.gradle" configurations.all { resolutionstrategy.cachedynamicversionsfor 5, 'minutes' resolutionstrategy.cachechangingmodulesfor 0, 'seconds' } buildscript { repositories { maven { url artifactoryurl } } dependencies { classpath (group: 'com.myorg', name: 'acustomplugin', version: '1.5.0-snapshot') { changing = true } } } allprojects { apply plugin: 'base' apply plugin: 'com.myorg.acustomplugin' }
my question is: how can specify cacheresolutionstrategy snapshot version in buildscript block?
specifying outside block, doesn't work (since buildscript block evaluated first, in order build scripts... ) cache strategy rules defined in scripts haven't been evaluated yet.
the resolution strategy should placed in buildscript block this
buildscript { repositories { mavenlocal() maven { url artifactoryurl } } dependencies { classpath (group: 'com.myorg', name: 'acustomplugin', version: '1.5.0-snapshot') { changing = true } } configurations.all { resolutionstrategy.cachedynamicversionsfor 5, 'minutes' resolutionstrategy.cachechangingmodulesfor 0, 'seconds' } }
Comments
Post a Comment