language: java

jdk:
  - openjdk7
  - oraclejdk8
  - oraclejdk9
  - oraclejdk10

jobs:
  include:
    - stage: Sonar check and code coverage reporting
      jdk: oraclejdk8
      addons:
        sonarcloud:
          organization: "valfirst-github"
          token:
            secure: ${SONAR_CLOUD_TOKEN}
      script:
        - mvn test jacoco:report coveralls:report
        - if [[ -n "${TRAVIS_PULL_REQUEST_SLUG}" && "${TRAVIS_PULL_REQUEST_SLUG}" != "${TRAVIS_REPO_SLUG}" ]]; then
            echo "The pull request from ${TRAVIS_PULL_REQUEST_SLUG} is an EXTERNAL pull request. Skip sonar analysis and Codacy coverage reporting.";
          else
            mvn sonar:sonar;
            sudo apt-get install jq;
            wget -O ~/codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url);
            java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/site/jacoco/jacoco.xml;
          fi

cache:
  directories:
    - '$HOME/.m2/repository'
    - '$HOME/.sonar/cache'

language: java

jdk:
  - openjdk7
  - oraclejdk8
  - oraclejdk9
  - openjdk10

jobs:
  include:
    - stage: Sonar check and code coverage reporting
      jdk: oraclejdk8
      addons:
        sonarcloud:
          organization: "valfirst-github"
          token:
            secure: ${SONAR_CLOUD_TOKEN}
      script:
        - mvn test jacoco:report coveralls:report
        - if [[ -n "${TRAVIS_PULL_REQUEST_SLUG}" && "${TRAVIS_PULL_REQUEST_SLUG}" != "${TRAVIS_REPO_SLUG}" ]]; then
            echo "The pull request from ${TRAVIS_PULL_REQUEST_SLUG} is an EXTERNAL pull request. Skip sonar analysis and Codacy coverage reporting.";
          else
            mvn sonar:sonar;
            sudo apt-get install jq;
            wget -O ~/codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url);
            java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/site/jacoco/jacoco.xml;
          fi

cache:
  directories:
    - '$HOME/.m2/repository'
    - '$HOME/.sonar/cache'

Switch from oraclejdk10 to openjdk10
Switch from oraclejdk10 to openjdk10

https://docs.travis-ci.com/user/languages/java/#using-java-10-and-later:
"Take note that oraclejdk10 is EOL since October 2018 and as such it’s not supported anymore on Travis CI. See https://www.oracle.com/technetwork/java/javase/eol-135779.html."