I have a gradle project with a lot of dependencies, and running a simple task (that simply prints out the classpath) takes about 12 seconds, even though all the dependencies have been downloaded and are available in cache.
If I turn my network interface off, and run the same task, it completes in about a second.
So, the question is why is gradle talking to internet every time? Is there some flag I can set to make it use the cache more aggressively? I tried googling it, and there is a lot of discussion about how to force gradle NOT use the cache, but I could not find anything about the opposite.
In response to the question in comments, my repositories
config looks like this:
repositories {
maven { url "${artifactoryUrl}/jcenter" }
maven { url "${artifactoryUrl}/libs-release-local" }
maven { url "${artifactoryUrl}/libs-snapshot-local" }
mavenCentral()
maven { url "http://maven.twttr.com" }
}
($artifactoryUrl
points to an instace of artifactory we are running internally).