【发布时间】:2012-05-09 08:52:40
【问题描述】:
告诉Gradle 以下内容的最简单方法是什么:
检索“junit”依赖项并获取其最新的“发布”版本。
管理 Maven 和 Ivy 存储库对我来说有点陌生。我尝试了以下步骤,它们导致Could not resolve dependency ... 错误:
写
compile "junit:junit:latest.release"并将存储库设置为仅mavenCentral()(但是,如果我说“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 documentation for dynamic versions
标签: java maven dependencies ivy gradle