如何告诉 Gradle
以最简单的方式获取 'junit' 依赖并使用其最新的 'release' 版本?
获取 'junit' 依赖,并使用其最新的 'release' 版本。
Maven 和 Ivy 仓库管理对我来说还比较陌生。我尝试了以下步骤,但出现了 Could not resolve dependency ...
错误:
将仓库设置为
mavenCentral()
,然后写入compile "junit:junit:latest.release"
(不过如果我改成"junit:junit:4.10"就可以了)。将仓库设置如下,然后写入
compile "junit:junit:latest.release"
:ivy { // I also tried 'http://maven.org' and other possible variants. url "http://repo1.maven.org" layout "maven" }
尝试使用Spring Source Ivy存储库:
ivy {
artifactPattern "http://repository.springsource.com/ivy/libraries/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
ivyPattern "http://repository.springsource.com/ivy/libraries/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
}
也许我误解了什么。为什么获取依赖项的最新版本会如此困难?
latest.integration
。Gradle 动态版本文档 - Bhavik