language: java
sudo: false
dist: trusty

matrix:
  include:
    - jdk: oraclejdk8
      addons: {apt: {packages: [oracle-java8-installer]}}
    - jdk: oraclejdk9
      before_install:
        - cd ~
        - wget http://download.java.net/java/jdk9/archive/175/binaries/jdk-9+175_linux-x64_bin.tar.gz
        - tar -xzf jdk-9+175_linux-x64_bin.tar.gz
        - export JAVA_HOME=~/jdk-9
        - PATH=$JAVA_HOME/bin:$PATH
        - cd -
      env:
        - JDK_JAVA_OPTIONS='--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED'

# Don't let Travis CI execute './gradlew assemble' by default
install:
# Disable Gradle daemon according to https://docs.gradle.org/4.0/userguide/gradle_daemon.html
# - mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
# Display Gradle, Groovy, JVM and other versions
  - ./gradlew -version

script:
  - ./gradlew build --scan

language: java
sudo: false
dist: trusty

matrix:
  include:
    - jdk: oraclejdk8
      addons: {apt: {packages: [oracle-java8-installer]}}
    - jdk: oraclejdk9
      before_install:
        - cd ~
        - wget http://download.java.net/java/jdk9/archive/175/binaries/jdk-9+175_linux-x64_bin.tar.gz
        - tar -xzf jdk-9+175_linux-x64_bin.tar.gz
        - export JAVA_HOME=~/jdk-9
        - PATH=$JAVA_HOME/bin:$PATH
        - cd -

# Don't let Travis CI execute './gradlew assemble' by default
install:
# Display Gradle, Groovy, JVM and other versions
  - ./gradlew -version

script:
  - ./gradlew build --scan

Remove JDK_JAVA_OPTIONS from jdk-9 build
Remove JDK_JAVA_OPTIONS from jdk-9 build

Since jdk-9+175 illegal access is allowed by default.

Warnings like the following are expected:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by [caller] to method java.lang.ClassLoader.getPackages()
WARNING: Please consider reporting this to the maintainers of [caller]
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
