[英]How to find out which the latest version of any dependency we include in Gradle is?
在gradle中我不使用動態版本,因為這可能導致不確定的構建。 所以我說出我的依賴關系:
compile 'com.squareup.okhttp:okhttp:2.2.0'
但是,如何確定是否有可用的新版本以及它的編號是多少?
您可以使用gradle-versions-plugin來執行此操作。 這個插件提供了dependencyUpdates
任務,其中
顯示最新,超過找到的最新版本,升級或無法解決的項目依賴關系的報告。
您需要做的就是通過配置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
}
}
並應用插件本身,:
apply plugin: 'com.github.ben-manes.versions'
您可以使用此站點搜索您的庫最新版本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.