$ command-helper

Gradle

Building and testing with the wrapper, running single tests, dependencies, build cache and diagnostics.

Requires Google sign-in

Build

Build with tests
./gradlew build
Build without tests
./gradlew build -x test
Clean
./gradlew clean
List available tasks
./gradlew tasks --all
Run the application
./gradlew bootRun

Spring Boot plugin; with the plain application plugin the task is run.

Task in one subproject
./gradlew :<subproject>:build

Tests

Run one test class
./gradlew test --tests '<test_class>'
Run tests matching a pattern
./gradlew test --tests '*<test_method>*'
Re-run tests even if up to date
./gradlew test --rerun

Dependencies

Runtime dependency tree
./gradlew dependencies --configuration runtimeClasspath
Why a library (and which version) is usedadvanced
./gradlew dependencyInsight --dependency <artifact_id> --configuration runtimeClasspath
Refresh dependencies
./gradlew build --refresh-dependencies

Speed and diagnostics

Use the build cache and parallel executionadvanced
./gradlew build --build-cache --parallel
Build report (what was slow)advanced
./gradlew build --scan
Stacktrace on failure
./gradlew build --stacktrace
Stop daemons (stuck or out of memory)
./gradlew --stop
Upgrade the wrapperadvanced
./gradlew wrapper --gradle-version latest