2015-09-25 55 views
0

我想通过Gradle(从我设置的私有存储库,而不是从maven中心)向Android项目添加工件,直接工件下载得很好,但是它的依赖关系没有被下载。Gradle没有下载链接到工件的依赖关系

这是我的代码:

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.example</groupId> 
    <artifactId>artifactId</artifactId> 
    <version>1.0.0</version> 
    <packaging>aar</packaging> 
    <dependencies> 
    <dependency> 
     <groupId>com.example</groupId> 
     <artifactId>dependencyId</artifactId> 
     <version>1.0.0</version> 
    </dependency> 
    </dependencies> 
</project> 

POM的依赖构件:

我的主神器的POM

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.example</groupId> 
    <artifactId>dependencyId</artifactId> 
    <version>1.0.0</version> 
</project> 

上的应用程序摇篮代码:

repositories { 
    maven { 
     url "<private-url-repo>" 
    } 
} 

dependencies { 
    compile('com.example:artifactId:[email protected]') 
} 

回答

0

我发现在尝试一些东西后如何做到这一点,所以张贴万一它有助于任何人。解决方法是将transitive = true;添加到像这样的依赖项中:

dependencies { 
    compile('com.example:artifactId:[email protected]') { 
     transitive = true;  
    } 
}