[英]How to find out which the latest version of any dependency we include in Gradle is?
In gradle I do not use dynamic versions because that could lead to indeterminate builds. 在gradle中我不使用动态版本,因为这可能导致不确定的构建。 So I state my dependencies like so:
所以我说出我的依赖关系:
compile 'com.squareup.okhttp:okhttp:2.2.0'
However, how do I find out if there is a new version available and what its number is? 但是,如何确定是否有可用的新版本以及它的编号是多少?
You can use a gradle-versions-plugin to do it. 您可以使用gradle-versions-plugin来执行此操作。 This plugin provides a
dependencyUpdates
task, which 这个插件提供了
dependencyUpdates
任务,其中
Displays a report of the project dependencies that are up-to-date, exceed the latest version found, have upgrades, or failed to be resolved.
显示最新,超过找到的最新版本,升级或无法解决的项目依赖关系的报告。
All you need to do, is to apply, by configuration of build.script dependencies, as: 您需要做的就是通过配置build.script依赖项来应用:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.11.3'
// classpath 'org.codehaus.groovy:groovy-backports-compat23:2.3.5' // uncomment if you're using Gradle 1.x
}
}
And applying the plugin itself, with: 并应用插件本身,:
apply plugin: 'com.github.ben-manes.versions'
您可以使用此站点搜索您的库最新版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.