Gradle中的依赖过期时发出警告 [英] Give a warning when a dependency is outdated in Gradle
问题描述
例如,我获得了以下依赖关系:
依赖项{
compile'com.nativelibs4java:bridj:0.6.2'
compile'net .java.dev.jna:jna:4.1.0'
compile'de.vorb:jtesseract:0.0.4'
compile'de.vorb:jleptonica:0.0.2'
testCompile 'junit:junit:4.11'
}
我希望他们经常更新。有些是在发布的版本,因此如果Gradle支持,自动更新可能是安全的,但我宁愿不这样做。其余部分显然处于alpha或beta阶段,更新可能会在理论上破坏一切。
所以作为具体的例子,如果 junit:junit:4.12
会被释放。
Gradle不附带这个功能开箱即用,但您可以查找第三方插件(或自行编写)。快速Google搜索出现了 https://github.com/ben-manes/gradle-versions-插件。
Using the Gradle build system, is it possible to give a warning during building when a newer version of a dependency is available?
I got the following dependencies for example:
dependencies {
compile 'com.nativelibs4java:bridj:0.6.2'
compile 'net.java.dev.jna:jna:4.1.0'
compile 'de.vorb:jtesseract:0.0.4'
compile 'de.vorb:jleptonica:0.0.2'
testCompile 'junit:junit:4.11'
}
And I expect them to be updated quite often. Some are in a released version, hence it could be safe to pull updates automatically if Gradle supports that, but I rather do not. And the rest is just clearly in an alpha or beta phase and updates could break everything theoretically.
So as concrete example I'd want a warning if junit:junit:4.12
gets released for example.
Gradle doesn't ship with this functionality out-of-the-box, but you could look out for a third-party plugin (or write your own). Quick Google search turned up https://github.com/ben-manes/gradle-versions-plugin.
这篇关于Gradle中的依赖过期时发出警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!