为什么gradle不在所有定义的maven repos中搜索依赖?
回购块定义:
repositories {
maven {
name = 'JBoss.org Maven repository'
url 'https://repository.jboss.org/nexus/content/groups/public'
}
maven {
name = 'spring-milestones'
url 'http://repo.springsource.org/libs-milestone/'
}
mavenCentral()
}
(假设我在子项目中的某个地方net.sf.json-lib:json-lib:2.2.1
)我收到:
* What went wrong:
Could not resolve all dependencies for configuration ':myproject:compileClasspath'.
> Could not find json-lib.jar (net.sf.json-lib:json-lib:2.2.1).
Searched in the following locations:
http://repo.springsource.org/libs-milestone/net/sf/json-lib/json-lib/2.2.1/json-lib-2.2.1.jar
为什么只有一个搜索位置?显然json-lib
存在于.mavenCentral()
有什么方法可以分析它,或者以某种方式调试?
PS如果我mavenCentral()
在repos列表中上移一个位置,我可以解决这个问题,但这会以同样的原因破坏另一个子项目的依赖解析——来自“spring”repo的东西在mavenCentral()
.