我想每次都推动 Gradle 重新下载我的 SNAPSHOT 依赖项。可以通过--refresh-dependencies
.
但我想以编程方式以另一种方式进行:
configurations.all {
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
dependencies {
compile(Libraries.staffdetails_biz) { changing = true }
}
(我知道如果版本是SNAPSHOT,不需要添加changing = true
,但添加它以防万一)
所以在那之后,当我运行我的应用程序时,./gradlew clean bootRun --info
我会看到下一个日志:
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
还有一个问题,它下载了 pom 文件,但不下载 jar。我应该在构建脚本中进行哪些更改以使其按预期工作?
只有当我指定
--refresh-dependencies
它会下载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