language: java
sudo: false
dist: trusty
jdk:
  - oraclejdk8
  - oraclejdk9
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
script: ./gradlew -I gradle/travis.gradle check --stacktrace

language: java
sudo: required
dist: trusty
jdk:
  - oraclejdk8
  - oraclejdk9
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
script: ./gradlew -I gradle/travis.gradle check

Switch to higher memory Travis
Switch to higher memory Travis

Trusty with sudo allows more memory. The builds seem to be failing due
to memory issues.
