Gradle distributions downloaded every time build executes

Hi, We noticed a strange behavior while executing Gradle builds from Jenkins. Every time we run a build new Distribution of Gradle is downloaded and installed in “.gradle/wrapper/dists” directory. After quick investigation we realized that “Gradle Wrapper” was used in some project that triggered download of particular Gradle distribution and its installation. The strange thing is it’s downloading the same version over and over again ( same version 4.10.2 and same size of the zip file ). I tried to replicate this behavior on my local machine and by switching to Gradle Wrapper and I updated “distributionUrl” to use 5.4.1 version of Gradle ( I used to use 5.3.1 installed locally ) and ran Build task for my project and there was no download of the 5.4.1 distribution.

questions:

  1. Is it possible to disable download process?
  2. If we keep downloading specified distribution is it possible to limit it to one instance?
  3. Why didn’t Gradle download new distribution locally?

Thank you in advance.

Gradle wrapper should behave like you expect - as also described in the documentation, each version should be downloaded once.

  1. Do you have a single build agent for Jenkins? If there are multiple machines, it’ll download on each machine the build runs on.
  2. On your machine, did you run with the wrapper? i.e, gradlew and not just gradle?

That was an issue with the Git repository. Developer published distribution to Git and used “gradlew” as as build wrapper, so every time they triggered a build the whole distribution was downloaded to the Jenkins box and unzipped. Go figure …

Hi

@vs777 Have you found any solution yet?

I have the same issue with gitlab.