# Allow custom Gradle versions to be specified in travis.yml

**URL:** <https://travis-ci.community/t/allow-custom-gradle-versions-to-be-specified-in-travis-yml/2751>\
**Category:** Feature Requests\
**Tags:** java\
**Created:** [March 21, 2019, 8:03pm UTC](https://travis-ci.community/t/allow-custom-gradle-versions-to-be-specified-in-travis-yml/2751 "2019-03-21T20:03:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![richiksc](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/richiksc/32/1918_2.png) [@richiksc](https://travis-ci.community/u/richiksc)\
**Post date:** [March 21, 2019, 8:03pm UTC](https://travis-ci.community/t/allow-custom-gradle-versions-to-be-specified-in-travis-yml/2751/1 "2019-03-21T20:03:01Z")

</div>

I use Travis CI to build and deploy my Java applications. I use Gradle as my build tool, and use Java 11. Travis CI has built-in support for Java 11 through specifiying `jdk: oraclejdk11`, however, the minimum Gradle version required to support JDK 11 is Gradle 5.0. Currently, the preinstalled Gradle version on the Trusty image is `4.0` and the preinstalled version on the Xenial image is `4.10.2`. Currently, to use Gradle 5.0 or any custom gradle version, I have to manually install it by adding this to my `.travis.yml`:

```auto
before_install:
  - wget http://services.gradle.org/distributions/gradle-5.3-bin.zip
  - unzip -qq gradle-5.3-bin.zip
  - export GRADLE_HOME=$PWD/gradle-5.3
  - export PATH=$GRADLE_HOME/bin:$PATH
  - gradle -v

```

It would be great if I could just specify a Gradle version like this:

```auto
gradle: 5.3

```

And Travis would install the correct version of Gradle before beginning the build. This would make using Travis easier for many Java developers.

---

<div class="post-metadata">

**Author:** ![0x8BADFOOD](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/0x8badfood/32/7022_2.png) [@0x8BADFOOD](https://travis-ci.community/u/0x8BADFOOD)\
**Post date:** [August 24, 2021, 2:50am UTC](https://travis-ci.community/t/allow-custom-gradle-versions-to-be-specified-in-travis-yml/2751/2 "2021-08-24T02:50:58Z")

</div>

Agreed. It would be nice to have.

---

<div class="post-metadata">

**Author:** ![Horcrux7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/horcrux7/32/8503_2.png) [@Horcrux7](https://travis-ci.community/u/Horcrux7)\
**Post date:** [February 26, 2023, 9:11pm UTC](https://travis-ci.community/t/allow-custom-gradle-versions-to-be-specified-in-travis-yml/2751/3 "2023-02-26T21:11:24Z")

</div>

Is this possible in the mean time? Travis use the very old version 5.1.1.

---

<div class="post-metadata">

**Author:** ![Horcrux7](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/horcrux7/32/8503_2.png) [@Horcrux7](https://travis-ci.community/u/Horcrux7)\
**Post date:** [February 26, 2023, 10:11pm UTC](https://travis-ci.community/t/allow-custom-gradle-versions-to-be-specified-in-travis-yml/2751/4 "2023-02-26T22:11:27Z")

</div>

No, it does not work. I need to use the `before_install:`
