[英]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 : 我看到以下文件:
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.