title: Cache gradle dependencies, Travis CI
body: <p>I'm trying to cache the dependencies for a private Travis CI repository, does Travis have some mechanism specific for gradle, or do I have to cache specific directories?</p>
  
  <p><strong>.travis.yml:</strong></p>
  
  <pre><code>language: groovy
  
  jdk:
    - openjdk7
  
  env:
  - TERM=dumb
  
  before_install:
  - cd application
  - chmod +x gradlew
  
  script:
  - ./gradlew build
  </code></pre>
  
  <p><strong>Relevant parts of last working build:</strong></p>
  
  <pre><code>Downloading https://services.gradle.org/distributions/gradle-2.1-bin.zip
  
  ......................................................................................................................................................................................
  
  Unzipping /home/travis/.gradle/wrapper/dists/gradle-2.1-bin/2pk0g2l49n2sbne636fhtlet6a/gradle-2.1-bin.zip to /home/travis/.gradle/wrapper/dists/gradle-2.1-bin/2pk0g2l49n2sbne636fhtlet6a
  
  Set executable permissions for: /home/travis/.gradle/wrapper/dists/gradle-2.1-bin/2pk0g2l49n2sbne636fhtlet6a/gradle-2.1/bin/gradle
  
  Download https://jcenter.bintray.com/com/mycila/xmltool/xmltool/3.3/xmltool-3.3.pom
  
  ...
  </code></pre>
  
  <p>Would adding:</p>
  
  <pre><code>cache:
    directories:
    - $HOME/.gradle
  </code></pre>
  
  <p>work? or perhaps:</p>
  
  <pre><code>cache:
    directories:
    - $HOME/.gradle/caches/modules-2/files-2.1
  </code></pre>