Disable the use of caches and use maven local repository


(jazz) #1

Since the last couple of versions (4.2 onwards?) the gradle cache has become more problematic. All maven dependencies are downloaded into the ~/.gradle/caches folder. This has drawbacks:

  • The IDE (IntelliJ) cannot find javadoc anymore.
  • The folder structure of maven is much cleaner than gradle caches
  • Gradle will happily download already available deps in maven local
  • When using a local nexus server these deps downloaded from this server will also end up in the local caches folder.

How to disable this behaviour and use the local maven repository only to store dependencies?

Thanks in advance for any pointers how to work around this!

Bart


(Fred Curts) #2

I don’t think there is a way to disable the dependency cache. Javadoc works fine for me; perhaps there’s a problem with your setup. Dependencies that already exist in Maven Local are copied into the Gradle cache and aren’t downloaded anew. (See https://docs.gradle.org/current/userguide/dependency_cache.html) For best results, avoid declaring mavenLocal() in Gradle, as this can slow down your build and make it less reproducible.