How do I route all artifact resolution including plugins through an internal repo?


(James Carpenter) #1

How do I route all artifact resolution (normal and plugins) through an internal Artifactory server?

repositories {maven { url “http://repo.mycompany.com/maven2”} } was not enough to prevent Maven central from supplying some artifacts.

As I vaguely recall, in Maven one has to list an internal repo as a mirror of central to do this. It is possible some of the repo definitions are coming in through transitive dependencies.

It would be helpful if the Gradle documentation explicitly addressed this use case. In my experience it is very common in a corporate setting to let a repo manager act as a caching proxy to external repos.


(Peter Niederwieser) #2

Gradle will only use the configured repositories. If you do get artifacts from Maven Central, then either this repository is declared in the build (or in an init script such as ‘~/.gradle/init.gradle’), or Artifactory is set up to proxy it.


(James Carpenter) #3

Is plugin resolution handled by a separate config?


(Peter Niederwieser) #4

Plugins are resolved from the repositories declared in ‘buildscript’ blocks. Like regular repositories, plugin repositories can be declared in build scripts and/or init scripts.