language: java

jdk:
  - openjdk7
  - oraclejdk8
  - oraclejdk9

jobs:
  include:
    - stage: Sonar check and code coverage reporting
      jdk: oraclejdk8
      addons:
        sonarcloud:
          organization: "valfirst-github"
          token:
            secure: ${SONAR_CLOUD_TOKEN}
      script:
        - 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)
        - mvn test jacoco:report coveralls:report sonar:sonar
        - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/site/jacoco/jacoco.xml

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

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:
        - 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)
        - mvn test jacoco:report coveralls:report sonar:sonar
        - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/site/jacoco/jacoco.xml

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

Build on Oracle JDK 10
Build on Oracle JDK 10