gradle-clean
Gradle build artifact removal task
TLDR
Clean build directory
$ gradle clean
Clean specific module$ gradle :module:clean
Clean and build$ gradle clean build
SYNOPSIS
gradle clean [options]
DESCRIPTION
gradle clean deletes the project build directory (the path set by `layout.buildDirectory`, by default `build/`) and everything in it. It removes compiled classes, packaged artifacts, and cached build output, ensuring a fresh build environment.The task is provided by Gradle's base plugin, which is applied by the Java, Application, and most other language plugins. It is useful when builds become inconsistent or caches are corrupted, forcing a complete rebuild on the next invocation.
PARAMETERS
cleanTaskName
Task rule that deletes only the outputs of a named task, e.g. `cleanJar` removes the JAR produced by the `jar` task.--info
Info logging.--help
Display help information.
CAVEATS
Removes all build output. Next build will be full rebuild. Doesn't clean dependencies.
HISTORY
The clean task is a standard Gradle lifecycle task for build artifact removal.
SEE ALSO
gradle(1), gradle-build(1)
