is there any way in Gradle or suggested way to specify the repository that should be used based on the artifacts’s attributes (e.g. group and name)?
With ivy you could have something like this:
<module organisation="foo" name="*" resolver="internal-repo" />
<module organisation="*" name="*" resolver="internet" />
I also see Gradle looks the artifacts in all the repositories, any way to have a “return first” approach? Maybe by having that we could solve the first problem I’ve mentioned.
This is currently not possible with Gradle. When resolving a dependency with a fixed version, gradle iterates over the list of repositories and stops on the first repository with a succesful resolve. If you don’t use fixed versions (e.g. latest.integration) gradle needs to iterate over all declared repositories to ensure it finds the “real” latest version.
Thanks, maybe an alternative solution to accomplish the repository per group/name would be to do that in the artifact repository (e.g. Artifactory’s virtual repo)?