How to clean build cache?

Hi Gradle Community,

I apologize if this is a trivial question.

Is it possible to tell Gradle to clear build cache and build everything from scratch (e.g. gradle --clear-build-cache)? There’s an option to manually remove the cache folder but that seems so hacky and “gradle clean” only removes the build folder. There’s a --no-build-cache option, but that’s just to tell the current build not to use the build cache.

Thank you.

Hi Kevin,

there currently isn’t a built-in solution for removing the local build cache folder. What is your use-case for removing the folder? Do you have a bad artifact in there?


Hi Stefan,

We would like to do a clean build especially when deploying to production and avoid the possibility of re-using existing bad artifacts. In a perfect world, there is no bad artifacts, but anything can happen will happen.