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/
branches:
  only:
    - master

language: java
cache:
  directories:
    - $HOME/.m2
branches:
  only:
    - master

Remove gradle caching stuff, cache m2 instead.
Remove gradle caching stuff, cache m2 instead.