简体   繁体   English

gradle无法在Maven存储库中找到工件

[英]gradle unable to find artifact in maven repository

I am doing a simple gradle build and I have deployed a particular artifact to my internal sonatype maven repo 我正在做一个简单的gradle构建,并且已经在我的内部sonatype Maven存储库中部署了一个特定的工件。

My build.gradle file looks like this: 我的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'
}

I run this command on the command line: gradle build 我在命令行上运行此命令:gradle build

I get this error: 我收到此错误:

> 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

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

I see the following files : 我看到以下文件:

  1. metrics-influxdb-0.7.1-ebay-20150708.054830-3.pom metrics-influxdb-0.7.1-ebay-20150708.054830-3.pom
  2. metrics-influxdb-0.7.1-ebay-20150708.054830-3.jar metrics-influxdb-0.7.1-ebay-20150708.054830-3.jar

So why is gradle looking for metrics-influxdb-0.7.1-ebay-20150708.054833-4.jar when my repo has 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

It seems like you have declared another dependency besides the one you showed above. 似乎您已经声明了除了上面显示的依赖之外的另一个依赖。 It should probably look something like this: 它可能看起来像这样:

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

If you find this dependency declaration, you might also find the source of the problem. 如果找到此依赖项声明,则可能还会找到问题的根源。

The second possibility is, that your maven-metadata.xml (at http://maven.ebay.com/nexus/content/repositories/sre-snapshots/net/alchim31/metrics-influxdb/0.7.1-ebay-SNAPSHOT/maven-metadata.xml ) is messed up and points towards the nonexisting build 4. 第二种可能性是,您的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。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Maven 本地存储库中找不到自定义 Gradle 插件 - Unable to find Custom Gradle Plugin in Maven Local repository 在Maven本地存储库中找不到工件 - Could not find artifact in maven local repository Maven找不到存储库中已存在的工件 - Maven could not find artifact that already exists in repository 使用Gradle将工件发布到s3上的远程maven存储库 - Publishing artifact to remote maven repository on s3 using Gradle 无法使用Travis将Maven工件部署到Maven中央存储库 - Unable to deploy maven artifact to maven central repository using travis 安装Maven时找不到工件 - Unable to find artifact when install maven Gradle 在 Z6B7B655DD22FAA3F1067Z07C512493AA8 中找到错误的 maven 存储库 url - Gradle find wrong maven repository url in eclipse Maven - 在中央存储库中找不到 Jackson 工件,尽管它存在? - Maven - can't find Jackson artifact in central repository although it exists? 如果应用java插件,Gradle将无法在复合构建中找到zip工件 - Gradle is unable to find zip artifact in composite build if java plugin is applied Maven 错误 - 无法在 https://repo.maven.apache.org/maven2 中找到工件已缓存在本地存储库中 - Maven Error - Failure to find artifact in https://repo.maven.apache.org/maven2 was cached in the local repository
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM