has anyone already solved the problem of gradle 8'...
# community-support
m
has anyone already solved the problem of gradle 8's zip file being too large to check-in to github? My goal is to eliminate downloading the file from gradle during every CircleCI execution (and Jenkins execution):
Copy code
remote: error: See <https://gh.io/lfs> for more information.
remote: error: File gradle/wrapper/gradle-8.11-bin.zip is 130.57 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - <https://git-lfs.github.com>.
t
Fwiw, I build inside Docker containers, and use the Gradle images from the Docker Hub, so using the
gradle
command (instead of
./gradlew
) inside a
gradle:8.11-jdk21
container will use the Gradle from the Docker image: the "cache" is your Docker image cache. (I also add steps to the pipelines that run
gradle wrapper
and check whether that modifies the
gradlew
and
gradle/wrapper/
of the project, to make sure things are in sync between the CI pipeline and the wrapper that the developers rely on)
m
I like this idea. Thank you.
t
We have an internal Jenkins library to make it easier (that also sets up an init script to use our repository manager for instance), so our pipelines look like:
Copy code
// Keep in sync with the Gradle wrapper
def gradleImageVersion = '8.14.2-jdk21'
// ...
    stage('Validate Gradle Wrapper') {
      steps {
        gradleInsideDocker(imageVersion: gradleImageVersion) {
          sh 'gradle wrapper'
        }
        verifyUnmodified('gradle/wrapper/gradle-wrapper.properties') {
          setGerritReview unsuccessfulMessage: 'Version of Gradle differs between Jenkinsfiles and the Gradle wrapper'
        }
      }
      post {
        unsuccessful {
          sh 'git restore -- gradlew* gradle/wrapper/'
        }
      }
    }
    stage('Build') {
      steps {
        gradleInsideDocker(imageVersion: gradleImageVersion) {
          sh 'gradle build'
        }
      }
    }
👍 1