Ughh, the saga continues (my post yesterday - Gradle could not resolve dependency from artifactory). I worked out the solution to this (I'm still using hard-coded versions).
But now when I gradle clean build
the project with a dependency on an artifact in Artifactory gradle fails to find it. It errors with:
* 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
I can hit this location with a browser or Curl to download the artifact or have a trace on it:
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
Why can't Gradle download it? It isn't being downloaded to my local .gradle cache.
Gradle could not resolve dependency from artifactory has a similar problem though I am using the http://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin.
Any thoughts?
Update
I changed my repo from the virtual libs-release
to the actual libs-release-local
and it worked. I haven't changed the configurations from the default in Artifactory and the virtual libs-release
includes libs-release-local
as a selected repository. Regardless, this virtual repository is resolved when going through curl, browser or ?trace, but not when going through Gradle. Why?
And other problem is that then the remote repositories (setup through the virtual libs-release
) are never used so the build fails as it can't find the remote artifacts.