Gradle
Building and testing with the wrapper, running single tests, dependencies, build cache and diagnostics.
Build
Build with tests
./gradlew buildBuild without tests
./gradlew build -x testClean
./gradlew cleanList available tasks
./gradlew tasks --allRun the application
./gradlew bootRunSpring 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 --rerunDependencies
Runtime dependency tree
./gradlew dependencies --configuration runtimeClasspathWhy a library (and which version) is usedadvanced
./gradlew dependencyInsight --dependency <artifact_id> --configuration runtimeClasspath
Refresh dependencies
./gradlew build --refresh-dependenciesSpeed and diagnostics
Use the build cache and parallel executionadvanced
./gradlew build --build-cache --parallelBuild report (what was slow)advanced
./gradlew build --scanStacktrace on failure
./gradlew build --stacktraceStop daemons (stuck or out of memory)
./gradlew --stopUpgrade the wrapperadvanced
./gradlew wrapper --gradle-version latest