【发布时间】:2018-12-26 05:17:36
【问题描述】:
在build.gradle 中,我们可以声明多个存储库,包括自定义的 Maven 存储库。就我而言,我使用两个自定义 Maven 存储库:一个用于发布,一个用于快照。还有一个mavenCentral 存储库。例如:
repositories {
maven {
url 'http://xxxx:8080/repository/internal'
}
maven {
url 'http://xxxx:8080/repository/snapshots'
}
mavenCentral()
}
dependencies {
compile 'xxxx:xxxx:1.0-SNAPSHOT'
}
Gradle 2.x 可以从http://xxxx:8080/repository/snapshots 解析SNAPSHOT 库。但是,Gradle 4.x 和 5.x 无法解析 SNAPSHOT 库。
从https://docs.gradle.org/current/userguide/declaring_repositories.html 看,我没有看到使用多个存储库的任何特殊要求,不确定是什么问题。
【问题讨论】:
标签: gradle