Gradle not picking up latest library/version from artifactory

自作多情 提交于 2019-12-12 01:39:30

问题


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 ?


回答1:


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'
}


来源:https://stackoverflow.com/questions/34365443/gradle-not-picking-up-latest-library-version-from-artifactory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!