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

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.

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.

Is plugin resolution handled by a separate config?

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.