Understanding the dependency cache

The dependency cache of Gradle tries to minimize the number of remote requests and downloads so that builds can be fast and reliable. The cache has two parts to perform proper dependency caching:

  • First, it has a cache for dependency metadata (POM or Ivy descriptor files) for a dependency group, name, and version. Gradle keeps a separate cache for each repository. So, if the same dependency is found in multiple repositories, then the metadata information is cached in multiple dependency metadata caches.
  • The dependency cache also has a single cache with downloaded artifacts for the dependencies. The multiple metadata caches share the same cache for downloaded artifacts. The artifacts are stored by the SHA1 hash code ...

Get Gradle Dependency Management now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.