Gradle正在查找POM而不是ZIP

x4shl7ld  于 2022-12-23  发布在  其他
关注(0)|答案(1)|浏览(113)

这是我的一部分建设。gradle:

apply plugin: 'java'

repositories {
    maven {
        url "https://artifactory.(...)/artifactory/jcenter/"
        credentials {
            username artifactoryUsername
            password artifactoryPassword
        }
    }
    maven {
        url "https://artifactory.(...)/artifactory/libs-release-local/"
        credentials {
            username artifactoryUsername
            password artifactoryPassword
        }
    }
}

configurations {
    [amq, amqBundles, amqExtensions]
}

dependencies {
    amq(group: 'com.redhat', name: 'amq-broker', version: '7.10.0', ext: 'zip')
    amqBundles(group: "org.postgresql", name: "postgresql", version: "42.2.14", ext: "jar")
    amqExtensions(group: "biz.paluch.logging", name: "logstash-gelf", version: "1.14.1", ext: "jar")
}

(...)

task extractAmq(type: Copy) {
    from configurations.amq.files
    into "$buildDir/software/amq"
}

这是我运行“gradle help”时遇到的错误:

A problem occurred evaluating root project 'installer'.
> Could not resolve all files for configuration ':amq'.
   > Could not find com.redhat:amq-broker:7.10.0.
     Searched in the following locations:
       - https://artifactory.(...)/artifactory/jcenter/com/redhat/amq-broker/7.10.0/amq-broker-7.10.0.pom
       - https://artifactory.(...)/artifactory/libs-release-local/com/redhat/amq-broker/7.10.0/amq-broker-7.10.0.pom
     Required by:
         project :

它在“from configurations.amq.files”行失败。
为什么它要查找.pom而不是.zip,我该如何解决这个问题?

vnjpjtjt

vnjpjtjt1#

我将metadataSources添加到存储库中,如下所示:

repositories {
    maven {
        url "https://artifactory.(...)/artifactory/jcenter/"
        credentials {
            username artifactoryUsername
            password artifactoryPassword
        }
        metadataSources{
            artifact()
        }
    }
    maven {
        url "https://artifactory.(...)/artifactory/libs-release-local/"
        credentials {
            username artifactoryUsername
            password artifactoryPassword
        }
        metadataSources{
            artifact()
        }
    }
}

它解决了这个问题。

相关问题