Gradle 无法解析标记为 'LATEST' 的依赖项的依赖项



我有以下 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.

如果我从GitHub上的存储库中查看原始项目,请切换到 v1 分支并进行mvn install,它可以正常工作。

我对问题的理解是 CLARITY 具有此依赖性:

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

,Gradle未能找到它,因为版本为LATEST

我该如何解决?

LATEST是maven关键字,gradle可能不太支持。作为解决方法,您可以尝试添加对Clarity-Protobuf的明确依赖性,并将latest.integration用作版本。

最新更新