Gradle无法解决标记为' LATEST'的依赖关系的依赖关系。

时间:2015-05-03 16:00:57

标签: java maven build gradle build.gradle

我有以下 build.gradle 文件:

apply plugin: 'java'

repositories {
    mavenCentral()
}

repositories {
    maven { url "http://oss.sonatype.org/content/repositories/snapshots" }
    maven { url "http://repo.maven.apache.org/maven2" }
}

dependencies {

    compile 'com.skadistats:clarity:1.2',
            'joda-time:joda-time:2.6',
            'com.google.code.gson:gson:2.3.1'
}

当我尝试compileJava时,我遇到以下错误:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/tim/Workspace/thedotabot/replay_parser/build.gradle' line: 11

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not find com.skadistats:clarity-protobuf:LATEST.
  Searched in the following locations:
      https://repo1.maven.org/maven2/com/skadistats/clarity-protobuf/LATEST/clarity-protobuf-LATEST.pom
      https://repo1.maven.org/maven2/com/skadistats/clarity-protobuf/LATEST/clarity-protobuf-LATEST.jar
      http://oss.sonatype.org/content/repositories/snapshots/com/skadistats/clarity-protobuf/LATEST/clarity-protobuf-LATEST.pom
      http://oss.sonatype.org/content/repositories/snapshots/com/skadistats/clarity-protobuf/LATEST/clarity-protobuf-LATEST.jar
      http://repo.maven.apache.org/maven2/com/skadistats/clarity-protobuf/LATEST/clarity-protobuf-LATEST.pom
      http://repo.maven.apache.org/maven2/com/skadistats/clarity-protobuf/LATEST/clarity-protobuf-LATEST.jar
  Required by:
      :replay_parser:1.0 > com.skadistats:clarity:1.2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

如果我从the repository on Github签出原始项目,请切换到 V1 分支并执行mvn install它可以正常工作。

我对这个问题的理解是清晰度具有这种依赖性:

<dependency>
    <groupId>com.skadistats</groupId>
    <artifactId>clarity-protobuf</artifactId>
    <version>LATEST</version>
</dependency>

Gradle无法找到它,因为版本为LATEST

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

LATEST是maven关键字,Gradle可能不太支持。作为一种解决方法,您可以尝试在clear-protobuf上添加显式依赖项,并使用latest.integration作为版本。