Gradle没有从artifactory中获取最新的库/版本 [英] Gradle not picking up latest library/version from artifactory
问题描述
我有项目A和B.项目B依赖A.
如果我为B构建快照,它将触发快照构建A.问题当A的最新快照被推送时,B不会选取最新的快照。相反,它会在那之前拿起那个。
有什么理由?我可以每次都抽出最新的快照吗?
如果您的依赖关系没有-SNAPSHOT,那么您可以具体告诉gradle,依赖关系是不断变化的这个:
依赖项{
编译组:group,name:artifact,version:1.0 ,改变:true
}
默认情况下,即使更改依赖项也会被缓存24小时。为了确保您将始终获得最新版本,请使用:
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, '秒'
}
I have project A and B. Project B depends on A.
If I build a snapshot for B, it will trigger a snapshot build on A. The issue is that when the latest snapshot of A gets pushed, B doesn't pick up the latest snapshot. Rather, it picks up the one before that.
Is there any reason why? And can I pull the latest snapshot every time ?
If your dependencies do not have the "-SNAPSHOT", you can specifically tell gradle that the dependency is a changing one like this:
dependencies {
compile group: "group", name: "artifact", version: "1.0", changing: true
}
However even changing dependencies are cached for 24 hours by default. To make sure you will always get the latest one, use:
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
这篇关于Gradle没有从artifactory中获取最新的库/版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!