Forrest logo
back to the gradle tool

gradle:tldr:a9739

gradle: Clear the build directory.
$ gradle clean
try on your machine

The command "gradle clean" is used to clean the build directory and delete all the compiled files, artifacts, and other build outputs generated by the Gradle build system.

When you execute this command, Gradle will delete the "build" directory in your project's root directory, along with all its subdirectories. This ensures that any previously built artifacts are removed, so the subsequent build is done from a clean state.

Cleaning the build directory can be useful when you want to start a fresh build or when you encounter issues with existing build artifacts that might be causing problems. It ensures that your next build starts from scratch, without any remnants from previous builds.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gradle tool