language: java
dist: trusty

jdk:
  - oraclejdk8
  - oraclejdk9
  - openjdk10
  - openjdk11
  - openjdk12

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 com.gavinmogan:codacy-maven-plugin:coverage -DcoverageReportFile=target/site/jacoco/jacoco.xml -DprojectToken=${CODACY_PROJECT_TOKEN} -DapiToken=${CODACY_API_TOKEN} -Dcommit=${TRAVIS_COMMIT};
          fi

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

language: java
dist: trusty

jdk:
  - oraclejdk8
  - oraclejdk9
  - openjdk10
  - openjdk11
  - openjdk12
  - openjdk13

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 com.gavinmogan:codacy-maven-plugin:coverage -DcoverageReportFile=target/site/jacoco/jacoco.xml -DprojectToken=${CODACY_PROJECT_TOKEN} -DapiToken=${CODACY_API_TOKEN} -Dcommit=${TRAVIS_COMMIT};
          fi

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

Add JDK 13 to build matrix
[CI] Add JDK 13 to build matrix