I feel like I'm missing something with Artifactory's 'virtual repos' concept. I'm new to both Artifactory and Gradle, having used Nexus and Maven before, and I don't remember ever encountering these types of issues in the past.
I feel like I have a fairly normal scenario, where I need mostly release dependencies, with a few snapshot dependencies during development.
The release dependencies are available from the virtual repo 'libs-release' (which includes 'libs-release-local', amongst other repos), and the snapshots are available in 'libs-snapshot'.
What I'm confused about is how I'm supposed to define this in Gradle, with the Artifactory plugin? From the docs and examples, I think I need something like:
artifactory {
contextUrl = 'http://my-artifactory/artifactory'
resolve {
repository {
repoKey = 'all-my-libs'
}
}
}
But that feels wrong - what's the point in the separate repos if I just lump them all together to use them? Comments in the answer to this question back up my concerns. That question talks about the /repo virtual repository, which for some reason isn't available to me. I get a 403 Forbidden if I try to use it.
Without Artifactory, I'd define multiple repositories like:
repositories {
// other repos...
maven { url 'http://my-artifactory/releases' }
maven { url 'http://my-artifactory/snapshots' }
}
but when I include the Artifactory plugin, it seems that the repositories closure is either ignored or butchered in some way - with something similar to the example above, and without the resolve closure, Gradle seems to only be attempting to get dependencies from the http://my-artifactory/snapshots repo, and failing (with 409 Conflict) when it tries to find release dependencies.
So - what am I missing? Should I be asking the person with admin rights on Artifactory to create a new virtual repo combining libs-release and libs-snapshot? Or something else?