sudo: required
language: java


env:
  global:
    - GRADLE_OPTS=-Xmx512m
    - CI=true

before_install:
  - wget https://github.com/sormuras/bach/raw/master/install-jdk.sh

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/

matrix:
  fast_finish: true
  allow_failures:
    - env: JDK='Oracle JDK 9'
  include:
    - env: JDK='OpenJDK 8'
      jdk: openjdk8
    - env: JDK='Oracle JDK 9'
      jdk: oraclejdk9
    - env: JDK='OpenJDK 9'
      install: . ./install-jdk.sh -F 9

script:
  - ./gradlew check --stacktrace --scan
after_success:
  - ./travis.sh deploy
  - ./travis.sh sonarqube


dist: trusty
sudo: required
language: java


env:
  global:
    - GRADLE_OPTS=-Xmx512m
    - CI=true

before_install:
  - wget https://github.com/sormuras/bach/raw/master/install-jdk.sh

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/

matrix:
  fast_finish: true
  allow_failures:
    - env: JDK='Oracle JDK 9'
  include:
    - env: JDK='OpenJDK 8'
      jdk: openjdk8
    - env: JDK='Oracle JDK 8'
      jdk: oraclejdk8
    - env: JDK='Oracle JDK 9'
      jdk: oraclejdk9
    - env: JDK='OpenJDK 9'
      install: . ./install-jdk.sh -F 9

script:
  - ./gradlew check --stacktrace --scan
after_success:
  - ./travis.sh deploy
  - ./travis.sh sonarqube


Use Trusty environment for oracle jdk8
Use Trusty environment for oracle jdk8

Based on inputs from this thread:
https://travis-ci.community/t/install-of-oracle-jdk-8-failing/3038/8