Gradle dependency caching



The 2.0 docs contains a section about how to setup Circle CI 2.0 for Maven projects:

Is there an example for Gradle as well? I’m mostly interested in how to implement caching of Gradle dependencies.



Great question! I am the “Java Language Owner” at CircleCI and have been working on making the Java experience on 2.0 A+.

AFAIK gradle does not have the equivalent of mvn dependency:go-offline so there is no great solution for caching everything.

I’ve looked through their docs but did not see anything that was very useful for our purposes.

Im still finishing up getting a lot of useful example apps, documentation, and convenience images made for Java projects. I started with Spring and Maven since they are the most popular on our platform, but will be covering gradle, sbt, and ant in the near future.


@levlaz take a look at this SO answer for inspiration. I’ve used the following in dependencies overrides sections in Circle 1.0 in the past.

task downloadDependencies(type: Exec) {
    commandLine 'echo', 'Downloaded all dependencies'

We were hoping a Gradle guide would be written too, and holding off a transition to 2.0 to have better guidance.


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.