gradle - Artifactory - ?trace 找到 artifact,gradle 没有

标签 gradle artifactory

呃,传奇还在继续(我昨天的帖子 - Gradle could not resolve dependency from artifactory)。我找到了解决方案(我仍在使用硬编码版本)。

但是现在当我 gradle clean build 依赖于 Artifactory gradle 中的 Artifactory 的项目无法找到它。它的错误是:

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not find apirCommon.jar (au.com.apir:apirCommon:1.0).
  Searched in the following locations:
      http://devsvr:8090/artifactory/libs-release/au/com/apir/apirCommon/1.0/apirCommon-1.0.jar

我可以使用浏览器或 Curl 访问此位置来下载 Artifactory 或对其进行跟踪:

http://devsrv/artifactory/libs-release/au/com/apir/apirCommon/1.0/apirCommon-1.0.jar?trace

Request ID: 31810f1c
Repo Path ID: libs-release:au/com/apir/apirCommon/1.0/apirCommon-1.0.jar
Method Name: GET
User: admin
Time: 2015-07-24T11:07:22.236+10:00
Thread: http-bio-8090-exec-21
Steps: 
2015-07-24T11:07:22.236+10:00 Received request
2015-07-24T11:07:22.236+10:00 Request source = 203.a.b.c, Last modified = 01-01-70 09:59:59 +10:00, If modified since = -1, Thread name = http-bio-8090-exec-21
2015-07-24T11:07:22.236+10:00 Executing any BeforeDownloadRequest user plugins that may exist
2015-07-24T11:07:22.236+10:00 Retrieving info
2015-07-24T11:07:22.236+10:00 Consulting the virtual repo download strategy
2015-07-24T11:07:22.236+10:00 Trying to retrieve resource info from the local storage
2015-07-24T11:07:22.236+10:00 Unable to find resource in libs-release:au/com/apir/apirCommon/1.0/apirCommon-1.0.jar
2015-07-24T11:07:22.236+10:00 Searching for info in aggregated repositories
2015-07-24T11:07:22.236+10:00 Preparing list of aggregated repositories to search in
2015-07-24T11:07:22.236+10:00 Appending the virtual repository 'libs-release'
2015-07-24T11:07:22.236+10:00 Appending the virtual repository 'libs-release'
2015-07-24T11:07:22.236+10:00 Appending the virtual repository 'libs-release'
2015-07-24T11:07:22.236+10:00 Appending collective local repositories
2015-07-24T11:07:22.236+10:00 Appending collective local cache repositories
2015-07-24T11:07:22.236+10:00 Appending collective remote repositories
2015-07-24T11:07:22.236+10:00 Intercepting info request with 'PomInterceptor'
2015-07-24T11:07:22.236+10:00 Intercepting info request with 'MavenMetadataInterceptor'
2015-07-24T11:07:22.236+10:00 Processing request as a release resource
2015-07-24T11:07:22.236+10:00 Searching for the resource within libs-release-local
2015-07-24T11:07:22.237+10:00 Resource was found in libs-release-local
2015-07-24T11:07:22.237+10:00 Resource is an exact match - returning
2015-07-24T11:07:22.237+10:00 Returning resource as found in the aggregated repositories
2015-07-24T11:07:22.237+10:00 Intercepting found resource with 'PomInterceptor'
2015-07-24T11:07:22.237+10:00 Intercepting found resource with 'MavenMetadataInterceptor'
2015-07-24T11:07:22.237+10:00 Requested resource is found = true
2015-07-24T11:07:22.237+10:00 Request is HEAD = false
2015-07-24T11:07:22.237+10:00 Request is for a checksum = false
2015-07-24T11:07:22.237+10:00 Target repository is not remote or doesn't store locally = true
2015-07-24T11:07:22.237+10:00 Requested resource was not modified = false
2015-07-24T11:07:22.237+10:00 Responding with found resource
2015-07-24T11:07:22.237+10:00 Executing any AltResponse user plugins that may exist
2015-07-24T11:07:22.237+10:00 Alternative response status is set to -1 and message to 'null'
2015-07-24T11:07:22.237+10:00 Found no alternative content handles
2015-07-24T11:07:22.237+10:00 Retrieving a content handle from target repo
2015-07-24T11:07:22.237+10:00 The requested resource isn't pre-resolved
2015-07-24T11:07:22.237+10:00 Target repository isn't virtual - verifying that downloading is allowed
2015-07-24T11:07:22.237+10:00 Creating a resource handle from 'libs-release-local:au/com/apir/apirCommon/1.0/apirCommon-1.0.jar'
2015-07-24T11:07:22.237+10:00 Identified requested resource as a file
2015-07-24T11:07:22.237+10:00 Requested resource is an ordinary artifact - using normal content handle with length '13368639'
2015-07-24T11:07:22.237+10:00 Executing any BeforeDownload user plugins that may exist
2015-07-24T11:07:22.237+10:00 Responding with selected content handle
2015-07-24T11:07:22.237+10:00 Request succeeded

为什么Gradle下载不了?它没有下载到我的本地 .gradle 缓存。

Gradle could not resolve dependency from artifactory尽管我使用的是 http://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin 也有类似的问题.

有什么想法吗?


更新

我将我的存储库从虚拟 libs-release 更改为实际的 libs-release-local 并且它起作用了。我没有更改 Artifactory 中的默认配置,虚拟 libs-release 包括 libs-release-local 作为选定的存储库。无论如何,这个虚拟存储库在通过 curl、浏览器或 ?trace 时会被解析,但在通过 Gradle 时不会。为什么?

另一个问题是远程存储库(通过虚拟 libs-release 设置)从未被使用,因此构建失败,因为它找不到远程 Artifactory .

最佳答案

我通过定义一个在各方面都完全相同(除了名称)的新虚拟存储库解决了这个问题。诡异的。

此外,我删除并重新创建了一个新的 libs-release 并且 gradle 构建失败并出现相同的错误!更奇怪。

关于gradle - Artifactory - ?trace 找到 artifact,gradle 没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31600670/

相关文章:

gradle - 使用Gradle将包装的OSGi bundle 发布到 Artifactory

artifactory - 镜面巧克力与 Artifactory

docker - 错误 : Unable to upload into a virtual repository without default local deployment configured (Docker artifactory)

android - Android-在gradle中如何排除依赖项中的某些资源文件?

ant - Gradle:无法创建任务或输入taskDef,名称未定义

android studio - Gradle 的问题

java - Jar 文件可以从 Gradle Run 运行,但在 Eclipse 中运行时出现 NoClassDefFoundError

java - Spigot 插件尝试包含 Apache Commons Text 时出现 NoClassDefFoundError

docker - 使用Jenkins的Artifactory插件,是否可以搜索存储库中具有属性的图像?

java - 在不放弃 SNAPSHOT 限定符的情况下想要 Artifact 可追溯性