相关疑难解决方法(0)

Gradle - 获取依赖项的最新版本

告诉Gradle以下内容最简单的方法是什么:

检索'junit'依赖关系并采用其最新的'release'版本.

管理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"
    }
    
    Run Code Online (Sandbox Code Playgroud)
  • 尝试使用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]"
    }
    
    Run Code Online (Sandbox Code Playgroud)

也许我误解了一些事情.为什么获得最新版本的依赖是如此艰巨的任务?

java dependencies ivy gradle maven

86
推荐指数
4
解决办法
8万
查看次数

标签 统计

dependencies ×1

gradle ×1

ivy ×1

java ×1

maven ×1