【发布时间】:2015-04-27 17:44:56
【问题描述】:
我有一个库,我称之为core,它是另一个项目的依赖项,称为Museum。在core的build.gradle中,我使用的是gson-fire,它以如下方式指定为依赖:
repositories {
maven { url 'https://raw.github.com/julman99/mvn-repo/master'}
}
...
dependencies {
compile 'com.github.julman99:gson-fire:0.11.0'
}
这工作正常 - core 已编译。但是,当我在 Museum 项目中使用它时,我得到以下信息:
A problem occurred configuring project ':Museum'.
> Could not resolve all dependencies for configuration ':Museum:_debugCompile'.
> Could not find com.github.julman99:gson-fire:0.11.0.
Searched in the following locations:
file:/Users/jwir3/.m2/repository/com/github/julman99/gson-fire/0.11.0/gson-fire-0.11.0.pom
file:/Users/jwir3/.m2/repository/com/github/julman99/gson-fire/0.11.0/gson-fire-0.11.0.jar
http://download.crashlytics.com/maven/com/github/julman99/gson-fire/0.11.0/gson-fire-0.11.0.pom
http://download.crashlytics.com/maven/com/github/julman99/gson-fire/0.11.0/gson-fire-0.11.0.jar
https://repo1.maven.org/maven2/com/github/julman99/gson-fire/0.11.0/gson-fire-0.11.0.pom
https://repo1.maven.org/maven2/com/github/julman99/gson-fire/0.11.0/gson-fire-0.11.0.jar
Required by:
museum:Museum:unspecified > com.jwir3.core:core:1.4.0-SNAPSHOT
Museum 的 build.gradle 如下所示:
dependencies {
compile ('com.thisclicks.core:core:' + project.CORE_LIB_VERSION+ '+@aar') {
transitive = true
}
}
推测这是因为core库在build.gradle的Museum中被指定为transient = true,但是它没有正确的位置来搜索gson-fire的Maven仓库。有没有办法让这些搜索位置以及依赖项本身都是瞬态的?
【问题讨论】:
-
为了记录,另一个类似问题的答案:How to declare repositories in Gradle generated POMs,其中Peter Niederwieser 声明 Gradle 本身在解析依赖项时不支持在 POM 中声明的存储库
标签: maven gradle dependency-management