.travis.yml
dist: trusty
language: java
jdk:
oraclejdk8
addons:
apt:
update: true
sonarcloud:
organization: "cesardl-github" # the key of the org you chose at step #3
token: ${SONAR_TOKEN} # encrypted value of your token
git:
depth: false
cache:
directories:
- $HOME/.m2
- $HOME/.sonar/cache
- $HOME/.sonarscanner
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- xvfb-run mvn clean verify
- if [ "$TRAVIS_BRANCH" = "master" ]; then sonar-scanner; fi
after_script:
- export JACOCO_SOURCE_PATH=src/main/java
- ./cc-test-reporter format-coverage target/site/jacoco/jacoco.xml --input-type jacoco
- ./cc-test-reporter upload-coverage