language: java
before_install:
  - 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)

jdk:
  - openjdk7
  - oraclejdk8

after_success:
  - mvn jacoco:report coveralls:report
  - jdk_switcher use oraclejdk8
  - java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r target/site/jacoco/jacoco.xml
  

language: java

jdk:
  - openjdk7
  - oraclejdk8

jobs:
  include:
    - stage: code coverage reporting
      jdk: oraclejdk8
      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
        - java -cp ~/codacy-coverage-reporter-assembly-latest.jar com.codacy.CodacyCoverageReporter -l Java -r target/site/jacoco/jacoco.xml

Optimize build process using Travis Build Stages
Optimize build process using Travis Build Stages