language: java

jdk:
  - openjdk11

notifications:
  email: false

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/

language: java

jdk:
  - openjdk11

notifications:
  email: false

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock

cache:
  directories:
    - $HOME/.gradle/caches/modules-2/
    - $HOME/.gradle/wrapper/

Exclude everything in .gradle/cache but modules-2
Exclude everything in .gradle/cache but modules-2

The other folders have contents that may change every run, and which ones
change is dependent on the gradle version. The other folders also don't seem to
have much that's useful. The plugin-resolution removal is also then doubly
unnecessary, as it is 1) not in modules-2 and 2) I don't see it being created
any more in Gradle 5.x.

Previously it was mirroring the Gradle documentation[1], so it is now clear the
docs are out-of-date.

1. https://docs.travis-ci.com/user/languages/java/#caching
