gpt4 book ai didi

java - gradle无法在Maven存储库中找到 Artifact

转载 作者:行者123 更新时间:2023-12-03 06:15:24 25 4
gpt4 key购买 nike

我正在做一个简单的gradle构建,并且已经在我的内部sonatype Maven存储库中部署了一个特定的 Artifact 。

我的build.gradle文件如下所示:

apply plugin: 'java'

sourceCompatibility = 1.8
version = '1.0'

repositories {
mavenCentral()
maven {url "http://maven.ebay.com/nexus/content/repositories/sre-snapshots/"}
}

dependencies {
compile group: "com.typesafe", name: "config", version: "1.3.0"
//compile project(':metrics')
compile group: 'com.ebay.telemetry', name: 'client-library', version: '0.1-SNAPSHOT'
compile group: "org.slf4j", name: "slf4j-jdk14", version: "1.7.12"
testCompile group: 'junit', name: 'junit', version: '4.11'
}

我在命令行上运行此命令:gradle build

我收到此错误:
> Could not find net.alchim31:metrics-influxdb:0.7.1-ebay-SNAPSHOT.
Searched in the following locations:
https://repo1.maven.org/maven2/net/alchim31/metrics-influxdb/0.7.1-ebay-SNAPSHOT/maven-metadata.xml
http://maven.ebay.com/nexus/content/repositories/sre-snapshots/net/alchim31/metrics-influxdb/0.7.1-ebay-SNAPSHOT/maven-metadata.xml
http://maven.ebay.com/nexus/content/repositories/sre-snapshots/net/alchim31/metrics-influxdb/0.7.1-ebay-SNAPSHOT/metrics-influxdb-0.7.1-ebay-20150708.054833-4.pom
http://maven.ebay.com/nexus/content/repositories/sre-snapshots/net/alchim31/metrics-influxdb/0.7.1-ebay-SNAPSHOT/metrics-influxdb-0.7.1-ebay-20150708.054833-4.jar

但是当我去 http://maven.ebay.com/nexus/content/repositories/sre-snapshots/net/alchim31/metrics-influxdb/0.7.1-ebay-SNAPSHOT/

我看到以下文件:
  • metrics-influxdb-0.7.1-ebay-20150708.054830-3.pom
  • metrics-influxdb-0.7.1-ebay-20150708.054830-3.jar

  • 那么当我的仓库中有gradle-metrics-influxdb-0.7.1-ebay-20150708.054830-3.jar时,gradle为什么要寻找metrics-influxdb-0.7.1-ebay-20150708.054833-4.jar

    最佳答案

    似乎您已经声明了除了上面显示的依赖之外的另一个依赖。它可能看起来像这样:

    compile group: 'net.alchim31', name: 'metrics-influxdb', version: '0.7.1-ebay-SNAPSHOT'

    如果找到此依赖项声明,则可能还会找到问题的根源。

    第二种可能性是,您的maven-metadata.xml(位于 http://maven.ebay.com/nexus/content/repositories/sre-snapshots/net/alchim31/metrics-influxdb/0.7.1-ebay-SNAPSHOT/maven-metadata.xml)被弄乱了,并指向不存在的内部版本4。

    关于java - gradle无法在Maven存储库中找到 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31284793/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com