Java, Maven and Gradle 25 cheatsheet
Java, Maven and Gradle 25: Gradle
13 common Java, Maven and Gradle 25 tasks.
Add the Gradle wrapper
Generate gradlew so everyone builds with the same Gradle version.
gradle wrapper
Run one test class
Run the tests in a single class.
./gradlew test --tests "com.example.UserServiceTest"
Build with Gradle without running tests
Exclude the test task from the build.
./gradlew build -x test
Find why a dependency is included
Show how a dependency is resolved and which dependency brings it in.
./gradlew dependencyInsight --dependency guava
Refresh dependencies
Ignore cached dependency resolution and check the repositories again.
./gradlew build --refresh-dependencies
Show a full stack trace
Print the stack trace of build failures to diagnose them.
./gradlew build --stacktrace