Gradle中的依赖过期时发出警告 [英] Give a warning when a dependency is outdated in Gradle

查看:651
本文介绍了Gradle中的依赖过期时发出警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Gradle构建系统时,是否可以在构建过程中发出警告,以提供更新版本的依赖项?

例如,我获得了以下依赖关系:

 依赖项{
compile'c​​om.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆