从maven pom.xml中对存储库中的Gradle搜索依赖性

时间:2015-08-05 15:42:00

标签: java android maven android-studio gradle

我有一个Android库依赖项,我从我自己的Maven存储库中引入(基于Artifactory):

compile "com.jmolsmobile.mylibrary:mylibrary:1.0.4"

此依赖项依赖于另一个库,该库位于具有自定义URL的另一个Maven存储库中:

repositories {
    maven { url 'https://mint.splunk.com/gradle/' } 
}

我想要做的是将我的Android库包含在另一个项目中,而不必将存储库URL显式添加到我的Gradle文件中,而是让我的项目通过Maven pom.xml继承存储库URL。 / p>

但Gradle不会在自定义存储库URL中搜索:

> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.splunk.mint:mint:4.2.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/splunk/mint/mint/4.2.1/mint-4.2.1.pom
         https://jcenter.bintray.com/com/splunk/mint/mint/4.2.1/mint-4.2.1.jar
         http://10.0.190.250:8081/artifactory/android-snapshot-local/com/splunk/mint/mint/4.2.1/mint-4.2.1.pom
         http://10.0.190.250:8081/artifactory/android-snapshot-local/com/splunk/mint/mint/4.2.1/mint-4.2.1.jar
         file:/Applications/Android-SDK/extras/android/m2repository/com/splunk/mint/mint/4.2.1/mint-4.2.1.pom
         file:/Applications/Android-SDK/extras/android/m2repository/com/splunk/mint/mint/4.2.1/mint-4.2.1.jar
         file:/Applications/Android-SDK/extras/google/m2repository/com/splunk/mint/mint/4.2.1/mint-4.2.1.pom
         file:/Applications/Android-SDK/extras/google/m2repository/com/splunk/mint/mint/4.2.1/mint-4.2.1.jar

即使在我的pom.xml

中明确定义了存储库
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.jmolsmobile.mylibrary</groupId>
    <artifactId>mylibrary</artifactId>
    <version>1.0.4</version>
    <packaging>aar</packaging>
    <repositories>
        <repository>
            <id>splunk</id>
            <url>https://mint.splunk.com/gradle/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>com.splunk.mint</groupId>
            <artifactId>mint</artifactId>
            <version>4.2.1</version>
        </dependency>
    </dependencies>
</project>

任何想法为什么会出错?

0 个答案:

没有答案