language: java
jdk:
  - oraclejdk8
  - oraclejdk7
  - openjdk7
env:
  - MAVEN_CONFIG=-DskipRelease
script: 
  - "./mvnw cobertura:cobertura"
  - jdk_switcher use oraclejdk8
  - "./mvnw org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.projectKey=io.springlets -Dsonar.login=$SONAR_TOKEN"
after_success:
  - bash <(curl -s https://codecov.io/bash)
cache:
  directories:
    - $HOME/.m2

language: java
jdk:
  - oraclejdk8
  - oraclejdk7
  - openjdk7
env:
  - MAVEN_CONFIG=-DskipRelease
script: 
  - './mvnw cobertura:cobertura'
  - 'if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]; then
      echo "Running sonar only for JDK version: $TRAVIS_JDK_VERSION";
      ./mvnw org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.projectKey=io.springlets -Dsonar.login=$SONAR_TOKEN || travis_terminate 1;
     fi'
after_success:
  - bash <(curl -s https://codecov.io/bash)
cache:
  directories:
    - $HOME/.m2

Change configuration to run sonar analysis only with oraclejdk8 to avoid triple analysis
Change configuration to run sonar analysis only with oraclejdk8 to avoid
triple analysis