Set specific version of gradle for CI build

Is there a mechanism by which the .gitlab-ci.yml file can insist on specific version of gradle (6.3+). I’m getting version 5.x and that can’t handle the current version of the jooq plugin as well as some features of the build file itself.

Hi Sargent,
you can do this, but it depends on which image are you using / how you are installing gradle in the job.

Can you please paste the relevant part of your .gitlab-ci.yml file?

Perhaps this is also visible at gitlab.com:camplab/sgs. The log of the build clearly name gradle version 5.4.1

This is the Gradle build system for JVM applications

https://gradle.org/

https://github.com/gradle/gradle

default:
image: gradle:alpine

Disable the Gradle daemon for Continuous Integration servers as correctness

is usually a priority over speed in CI environments. Using a fresh

runtime for each build is more reliable since the runtime is completely

isolated from any previous builds.

variables:
GRADLE_OPTS: “-Dorg.gradle.daemon=false”
CI_DEBUG_SERVICES: trace

stages:

  • release

before_script:

  • export GRADLE_USER_HOME=pwd/.gradle

release:
stage: release
script:
- gradle --build-cache assemble
- echo "Building in " $(pwd)
cache:
key: “$CI_COMMIT_REF_NAME”
policy: push
paths:
- build
- .gradle
artifacts:
paths:
- build/distributions/*
- build/libs/*
expire_in: 1 month

This is the reason you have an old version of gradle. The gradle:alpine Docker image hasn’t been updated for over a year.

If you want a Docker image with gradle 6.3, you have to choose one among these, based on which version of JRE or JDK you want

Thank you very much