gradle
Gradle 8+Quick reference for the Gradle CLI: project tasks, dependency management, multi-project builds, wrapper, configuration cache, and build scan — with common options and practical examples.
30 commands
Tasks
gradle tasksList every task the current build defines, grouped by category. `--all` shows internal / hidden tasks too.
--all; --group=<group>; --quiet
gradle tasks --allgradle helpPrint help text for a specific task: description, group, declared inputs / outputs.
gradle help --task buildgradle :<module>:tasksList tasks for a specific subproject in a multi-project build (replace `<module>` with the Gradle path).
gradle :web:tasks --allLifecycle
gradle buildRun the standard JVM build chain: `compile → processResources → classes → jar → test → check → assemble` (and a zip distribution if configured).
-x <task> exclude task; --parallel; --build-cache; --configuration-cache
gradle build -x testgradle cleanDelete the build directory (`build/`) so the next build re-runs every task from scratch.
--no-rebuild don't auto-trigger the default lifecycle
gradle clean buildgradle assembleCompile and package everything but skip the verification / test tasks. Faster feedback when you only need the jar.
gradle assemblegradle checkRun all verification tasks (`test`, `lint`, etc.) without producing a jar. Use in CI as the pre-merge gate.
--continue keep going after a task failure
gradle check --continuegradle testRun unit tests (Test task). Use `--tests <pattern>` to narrow to specific classes / methods.
--tests com.acme.UserServiceTest; --tests '*User*'; --info
gradle test --tests 'com.acme.*ServiceTest'Dependencies
gradle dependenciesPrint the resolved dependency tree for a configuration (e.g. `compileClasspath`, `runtimeClasspath`, `testCompileClasspath`).
--configuration <name>; --all show every config
gradle dependencies --configuration runtimeClasspath | grep -i slf4jgradle dependencyInsight --dependency <id>Explain why a single dependency ended up at a specific version — useful for resolving version conflicts.
--dependency <group:artifact>; --configuration <name>
gradle dependencyInsight --dependency com.fasterxml.jackson.core:jackson-databindgradle buildEnvironmentPrint the resolved build-script classpath — every plugin / helper library the build itself uses.
gradle buildEnvironmentgradle refresh-dependenciesForce re-resolution of dynamic versions and snapshot dependencies.
--refresh-keys
gradle build --refresh-dependenciesMulti-project
gradle projectsList every project in the reactor (root + subprojects) with their project paths and descriptions.
gradle projectsgradle :<module>:<task>Run a task in one subproject by Gradle path (`:` separator).
-p <dir> start from a subdir
gradle :order-service:test :web:assemblegradle <task> --parallelExecute independent tasks in parallel — useful for multi-module builds with independent test suites.
--max-workers=<N>; --no-parallel
gradle test --parallel --max-workers=4Performance
gradle --build-cache <task>Enable the local build cache (task outputs reused across branches / branches). Combine with a remote cache in `settings.gradle` for CI.
--no-build-cache
gradle assemble --build-cachegradle --configuration-cache <task>Gradle 8.x — cache the configuration phase for sub-millisecond startup of large multi-project builds.
--no-configuration-cache
gradle test --configuration-cachegradle --no-daemon <task>Disable the Gradle daemon — useful for low-memory CI or for diagnosing daemon-only bugs.
gradle --no-daemon testgradle --stopStop all running Gradle daemons. Pair with a clean rebuild if cached state is suspect.
gradle --stop && gradle clean buildDiagnose
gradle --scan <task>Run a task then publish a build scan (link printed at end). Requires accepting the Build Scan terms once.
--scan -Dscan.tag.<name>=<value>
gradle assemble --scangradle --info <task>Enable INFO logging — task start / finish, up-to-date checks, dependency resolutions.
--debug / -d even more detail
gradle test --info | tee gradle-info.loggradle --stacktrace <task>Print full stack traces on any failure.
--warning-mode=all show every deprecation warning
gradle build --stacktraceWrapper
./gradlew <task>Run a task through the Gradle Wrapper — uses the Gradle version pinned in `gradle/wrapper/gradle-wrapper.properties`.
./gradlew clean buildgradle wrapper --gradle-version <v>Generate / refresh the wrapper files with a specific Gradle distribution.
--distribution-type bin | all; --gradle-distribution-url <url>
gradle wrapper --gradle-version 8.7 --distribution-type binPublish
gradle publishUpload artifacts to the repository declared under `publishing` in `build.gradle`. Common targets: Maven Central via Sonatype, private Nexus / Artifactory.
-Drelease.useAutomaticVersion=true; -PpublishTo=staging
gradle publishToMavenLocalgradle publishToMavenLocalInstall the build into the local Maven repository (`~/.m2/repository`) so a neighboring Maven build can depend on it.
gradle publishToMavenLocalMisc
gradle --versionPrint Gradle / JVM / OS info, including the daemon status.
gradle --versiongradle propertiesList every project property (ext.*, gradle.*, system) — useful when chasing overridden values.
gradle properties | grep versiongradle initBootstrap a new Gradle project: choose DSL (Groovy / Kotlin), pick a project type, optionally wire a Git remote.
--type basic; --type java-application; --type java-library; --dsl groovy|kotlin
gradle init --type java-library --dsl kotlingradle :<module>:tasks --group <name>Filter the task list to a single task group (e.g. `build`, `verification`, `documentation`, `help`).
gradle tasks --group verificationRelated command cheatsheets
maven
Quick reference for Maven CLI commands: project lifecycle phases, dependency management, plugins, multi-module reactors, repository deployment, and debugging — with common options and practical examples.
34 commands
Maven 3.9+
mvnd
Quick reference for Maven Daemon (mvnd) — a long-lived JVM wrapper around `mvn` that keeps a background daemon to skip JVM startup on every build. Same CLI as Maven, plus daemon management commands.
29 commands
Maven Daemon 1.0+
Trademark & Use Notice
These command-line tool cheatsheets are open community references. The names, logos, and trademarks of the tools referenced here (such as Git™, Docker™, Kubernetes®, kubectl, PostgreSQL®, MySQL®, Redis™, MongoDB®, Linux™, PowerShell™, Vim™, and others) are the property of their respective owners and are used here solely for identification and reference purposes.
All content in these cheatsheets is independently authored as a simplified, self-contained reference. It is not affiliated with, endorsed by, or sourced from any official documentation. Command listings, flag descriptions, and examples are original simplifications; for authoritative information please consult the official documentation of each tool.
Command syntax and option flags may differ across tool versions. The version tags shown reflect stable releases; behavior may differ in other versions. This cheatsheet does not imply any preference or recommendation by the trademark holders.
If a trademark or copyright owner believes that any content on this site infringes their rights, please send an email to [email protected]. Upon receiving valid proof of rights, we will modify or remove the relevant content within a reasonable period.
This website assumes no legal liability for any direct or indirect losses arising from the use of information presented on these pages.
About Gradle
Gradle is a JVM-based build tool first released in 2008 (by Hans Dockter and the Gradleware / Gradle Inc team). It was created to combine the expressiveness of Apache Ant with the dependency management of Apache Ivy, all wrapped in a Groovy-based DSL that is now also available in Kotlin (Kotlin DSL, `.kts`). Gradle powers Android builds (Android Studio uses Gradle by default), Spring Boot starters, Kotlin Multiplatform, and many large JVM monorepos. The current stable line is Gradle 8.x (8.7+). Gradle excels at incremental builds via task input/output fingerprinting, parallel task execution, the build cache (local + remote), and the configuration cache (8.x). Tasks are declared in `build.gradle` / `build.gradle.kts` and grouped into chains via `dependsOn`; plugins add new tasks (`java`, `java-library`, `application`, `org.springframework.boot`, `com.android.application`). Gradle never uploads source code — only the artifacts declared by publishing plugins. The wrapper (`gradlew`) bundles a small launcher that downloads the Gradle distribution pinned in `gradle-wrapper.properties`, guaranteeing every developer and CI agent uses the same Gradle version.
Cheatsheet version 1.0.0