Gradle Cheat Sheet

The flexible JVM/Android build tool — tasks, daemon, caching, and dependency insight.

Build & Package4 sections · 21 commands
⌘K

Tasks & Lifecycle

7
./gradlew build

Compile, test, and assemble (incl. checks)

./gradlew clean

Delete build outputs

./gradlew test

Run tests

./gradlew tasks

List available tasks

./gradlew assemble

Just package, skip tests

./gradlew check

Run verification (tests + lint)

./gradlew --dry-run build

Show what would run

Dependencies

4
./gradlew dependencies

Resolved dependency list

./gradlew dependencyInsight --dependency slf4j-api

Why a library is present

./gradlew dependencies --configuration runtimeClasspath

One configuration

./gradlew wrapper --gradle-version 8.7

Update the wrapper

Daemon & Performance

6
./gradlew --no-daemon build

Don't reuse the daemon

./gradlew --stop

Stop running daemons

./gradlew --parallel build

Parallel module builds

./gradlew --offline build

Use cached dependencies only

./gradlew --info build

Informative logging

gradle --version

Installed version and JVM

Kotlin DSL

4
plugins { id 'java' }

Apply an id via the plugins block

dependencies { implementation(...) }

Declare a dependency

repositories { mavenCentral() }

Resolution repositories

test { useJUnitPlatform() }

Enable JUnit 5