language: java

before_cache:
    - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
    - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
    
cache:
    directories:
        - $HOME/.gradle/caches/
        - $HOME/.gradle/wrapper/
        
before_install:
 - chmod +x gradlew

jdk:
    - oraclejdk8
    
script:
    - ./gradlew assemble
    - ./gradlew check
    
after_script:
    - if [ -e ./gradlew ]; then ./gradlew jacocoTestReport;else gradle jacocoTestReport;fi
    - bash <(curl -s https://codecov.io/bash)

language: java

before_cache:
    - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
    - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
    
cache:
    directories:
        - $HOME/.gradle/caches/
        - $HOME/.gradle/wrapper/
        
before_install:
 - chmod +x gradlew

jdk:
    - oraclejdk8
    
addons:
    apt:
        packages:
            - oracle-java8-installer
    
script:
    - ./gradlew assemble
    - ./gradlew check
    
after_script:
    - if [ -e ./gradlew ]; then ./gradlew jacocoTestReport;else gradle jacocoTestReport;fi
    - bash <(curl -s https://codecov.io/bash)

Fix for old JDK being used.
Fix for old JDK being used.

https://github.com/travis-ci/travis-ci/issues/3259#issuecomment-130860338