sudo: false
language: java

env:
  global:
    - GRADLE_OPTS=-Xmx512m

before_script:
  - if [[ "x$JDK" == *'x9'* ]]; then remove_dir_from_path $JAVA_HOME/bin; export JAVA_HOME=/usr/lib/jvm/java-9-oracle; export PATH=$JAVA_HOME/bin:$PATH; java -Xmx32m -version; fi

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=9
  include:
    - jdk: oraclejdk8
    - jdk: oraclejdk8
      addons:
        apt:
          packages:
            - oracle-java9-installer
      env: JDK=9
    - jdk: oraclejdk7
    - jdk: openjdk7

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


sudo: false
language: java


env:
  global:
    - GRADLE_OPTS=-Xmx512m

before_script:
  - if [[ "x$JDK" == *'x9'* ]]; then remove_dir_from_path $JAVA_HOME/bin; export JAVA_HOME=/usr/lib/jvm/java-9-oracle; export PATH=$JAVA_HOME/bin:$PATH; java -Xmx32m -version; fi

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=9
  include:
    - jdk: oraclejdk8
    - jdk: oraclejdk8
      addons:
        apt:
          packages:
            - oracle-java9-installer
      env: JDK=9
    - jdk: oraclejdk7
      dist: precise
    - jdk: openjdk7
      dist: precise

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


Fix OpenJDK7 failures on Travis
Fix OpenJDK7 failures on Travis

More details can be found in this issue:

https://github.com/gradle/gradle/issues/2421