I'm using the Gradle wrapper to build various projects and noticed that my .gradle
directory now contains multiple copies of each Gradle distribution. Each copy is in a unique subdirectory as shown:
This has happened with every version of Gradle that I have under .gradle
, up through gradle-2.2.1-all
. Why do these copies exist and how are they selected by the Gradle wrapper?
The only evidence I've found is the Gradle documentation for distributionUrl:
The wrapper downloads a certain distribution only once and caches it.
These subdirectories may be a hash computed from the distributionUrl
in gradle-wrapper.properties
. http
and https
variants of the URL could contribute up to two copies, which is the number of copies that most of my distributions have. That doesn't explain the third copy in gradle-1.12-all
though.