We’ve got a CI server that runs a lot of jobs which all uses Gradle. Because it’s CI, Gradle are set to run with ‘–no-daemon’. However, we’ve notice that the ‘.gradle’ folder grown to 17G, out of which 16G is taken up by ‘jarSanpshots.bin’ under ‘caches’. Does anybody know what is this file?
We don’t use a lot of third party libraries (54MB in total) and run our own repository. One of job does produce some large artifacts (up to 200/300MB) but are these files ‘cached’ by Gradle? If it’s cached, 17G looks a bit too much and is it possible to configure the caching behaviours?
This file is used by Gradle incremental Java compilation. Basically this is used to store classpath JAR hashes. One option, if you aren’t doing incremental builds in CI is to disable incremental compilation since it won’t provide a benefit anyway. It’s also perfectly safe to periodically clean out this cache.
We don’t need to do incremental build on CI server since most jobs just check out fresh copies everytime. So how do you disable incremental builds? I tried to google it but people who do this just set the task’s up-to-date check to false, which is not acceptable when running on dev machines.