呃,传奇继续(我的帖子昨天 - Gradle could not resolve dependency from artifactory)。我找到了解决方案(我还在使用硬编码版本)。
但是现在当我gradle clean build
时,依赖Artifactory gradle中的工件的项目无法找到它。它出错了:
* 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点击此位置以下载工件或对其进行跟踪:
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,browser或?trace时会得到解决,但在通过Gradle时则无法解析。为什么呢?
还有一个问题是,从未使用远程存储库(通过虚拟libs-release
进行设置),因此构建失败,因为它无法找到远程工件。
答案 0 :(得分:0)
我通过定义一个在各个方面完全相同的新虚拟存储库(名称除外)来解决问题。奇怪的。
除此之外,我删除并重新创建了一个新的libs-release
,并且gradle构建失败并出现相同的错误!新奇。