I am encountering a problem when trying to use dynamic version numbers along with an Artifactory repository which is configured to not allow anonymous read access.
if I run ‘gw dep --refresh-dependencies’ I get an error such as:
Could not find any version that matches group:org, module:Foo, version:1.1.0.+.
However, if I change the build script to refer to a specific version number then ‘gw dep --refresh-dependencies’ would be successful e.g.
blah
\--- org:Foo:1.1.0.37
From my investigation the problem has nothing to do with the local dependency cache. Rather it seems to be an authentication problem. In the error case the Artifactory logs contain lines such as:
2012-12-10 14:47:05,671 [DENIED DOWNLOAD] my-repo:org/Foo for anonymous/11.22.33.44.
In the successful case, the Artifactory logs contains:
2012-12-10 15:16:20,549 [ACCEPTED DOWNLOAD] my-repo:org/Foo/1.1.0.37/ivy-1.1.0.37.xml for neil/11.22.33.44.
Do you have any idea why Gradle isn’t using my credentials for resolving dynamic versions?
I forgot about this issue, but it’s still happening and I’m using Gradle 1.4 now. Here’s the gist: https://gist.github.com/anonymous/5264592. I’ll try it on Gradle 1.5.
Looking at the Gradle 1.5 logs, the attempt to list available versions of “org:my_module:+” is not failing, but no results are returned by Artifactory. The url being requested is ‘http://myartifactoryserver/artifactory/libs-release-local/org/my_module/’. The server does not request authentication, so we do not provide it.
My suspicion is that Artifactory is somehow configured to be accessible to anonymous access, but it provides an empty directory listing in this case.
Here is a selection of the log output that makes it apparent what’s going on:
If I visit a valid location on the server then I see a directory listing with no files. If I intentionally visit an invalid location then I get an HTTP ERROR 404. This confirms your hypothesis.
I’ve tried a new installation of Artifactory 2.6.7 and the same thing happens. It looks like it’s a problem with Artifactory.
What should the HTTP status code actually be in order for Gradle to retry supplying credentials?