最佳答案
告诉 Gradle
以下事情最简单的方法是什么:
检索“ junit”依赖关系并获取其最新的“ release”版本。
管理 Maven 和 Ivy 存储库对我来说有点新鲜。我尝试了以下步骤,结果是 Could not resolve dependency ...
错误:
编写只将存储库设置为 mavenCentral()
(但是,如果我说“ junit: junit: 4.10”,它就可以工作)。的 compile "junit:junit:latest.release"
使用以下方式设置存储库编写 compile "junit:junit:latest.release"
:
ivy {
// I also tried 'http://maven.org' and other possible variants.
url "http://repo1.maven.org"
layout "maven"
}
Attempted to use Spring Source Ivy repository:
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]"
}
Maybe I misunderstand something. Why would getting the latest version of the dependency be such a hard task?