无法通过Artifactory找到在Gradle buildscript块中声明的依赖项

时间:2016-08-02 15:29:05

标签: gradle artifactory

我使用Artifactory作为我的工件存储,并设置了它,以便它被用作jcenter的代理和缓存。除了在我的主buildscript的{​​{1}}块中声明的依赖项之外,这通常正常工作。

我的块看起来像

build.gradle

在运行buildscript { repositories { //proxies jcenter maven { url "https://<myArtiInstance>/artifactory/repo" credentials { username artifactory_reader_username password artifactory_reader_password } } } dependencies { classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1" classpath "com.android.tools.build:gradle:2.1.2" } } gradlew clean build

时会出错
2.10

如果我将上面的url放入我的(经过身份验证的)浏览器中,我会得到jar并且可以看到它放入arti缓存中。

我所有其他代理依赖项似乎都有效,所以我对最新情况感到有些困惑。

目前我想知道这是否是Gradle 2.10或其他什么的错误,因为我曾经在我的arti框中看到该工件的先前缓存版本。

感谢您提供任何帮助或指示:)

编辑:如果我回滚到不在我的缓存仓库中的A problem occurred configuring root project 'android'. > Could not resolve all dependencies for configuration ':classpath'. > Could not find builder.jar (com.android.tools.build:builder:2.1.2). Searched in the following locations: https://<myArtiInstance>/artifactory/repo/com/android/tools/build/builder/2.1.2/builder-2.1.2.jar ,则构建完成正常并将其缓存。出于某种原因,它不喜欢com.android.tools.build:gradle:2.1.0,我想知道为什么?!

EDIT2:仍然存在问题,现在问题与2.1.2一起出现了与上述相似的错误

https://<myArtiInstance>/artifactory/repo/com/google/guava/guava/15.0/guava-15.0.jar

这再次来自* What went wrong: A problem occurred configuring root project '<name>'. > Could not resolve all dependencies for configuration ':classpath'. > Could not find guava.jar (com.google.guava:guava:15.0). Searched in the following locations: https://<myAriInstance>/artifactory/repo/com/google/guava/guava/15.0/guava-15.0.jar 块内指定的dependecency。有什么想法吗?这个时间是转变的,所以我不能交换版本。我从错误消息中注意到的唯一奇怪的事情是它在buildscript结尾的网址中查找guava.jar ...

1 个答案:

答案 0 :(得分:1)

所以事实证明第二次检查gradlew clean build --debug的输出,我注意到除了上面的失败的罐子之外,所有东西都是从本地~/.gradle/cache获得的。 rm缓存,一切正常,传递依赖关系可以从错误消息中给出的url获得。从本地缓存中检索的后续构建工作正常。在我看来,某些东西破坏了本地缓存(可能部分下载完整资源,即pomjar等依赖项),并且gradle错误消息不正确。

编辑:测试只是从缓存中删除jar并仍然编译好......