Gradle Command Helper
Runs locally in your browser. Your input is not uploaded.Free, no sign-up
Tasks
Flags
Command
./gradlew clean build
- clean
- Delete the build/ directory.
- build
- Compile, test and package: assemble + check.
Common commands
- Show the runtime dependency tree
./gradlew dependencies --configuration runtimeClasspath - Find why a library is on the classpath
./gradlew dependencyInsight --dependency jackson-databind --configuration runtimeClasspath - List all tasks
./gradlew tasks --all - Run one test method
./gradlew test --tests com.example.OrderServiceTest.createsOrder - Run tests again even if up to date
./gradlew test --rerun - Run a Spring Boot app with a profile
./gradlew bootRun --args=--spring.profiles.active=dev - Build a container image (Spring Boot)
./gradlew bootBuildImage - Re-download dependencies
./gradlew build --refresh-dependencies - Upgrade the Gradle Wrapper
./gradlew wrapper --gradle-version latest - Show the project's properties
./gradlew properties - Stop background daemons
./gradlew --stop
Build common Gradle commands and flags.
How to use the Gradle Command Helper
- Pick your shell, and whether the project has the Gradle Wrapper (it usually does).
- Tick the tasks to run, and optionally the subprojects, tests to filter and tasks to exclude.
- Add flags, then copy the command. Each part is explained below it, and the flags worth keeping are shown as
gradle.propertieslines.
Tips
- Task options follow their task:
--testsbelongs aftertest, and--argsafterbootRun. To filter the testsbuildruns, the command namestest --tests …first. - Subprojects:
:api:testruns only the api project's tests; plaintestruns it in every project that has the task. - Faster builds: the build cache, parallel execution and the configuration cache usually help most. Put them in
gradle.propertiesso everyone gets them.
Frequently asked questions
Should I use gradle or gradlew?
Use the wrapper (./gradlew, or gradlew.bat on Windows) when the project has one. It downloads the Gradle version the build was written for, so every machine and CI runner builds the same way.
How do I run a single test?
./gradlew test --tests com.example.OrderServiceTest.createsOrder. Use the class name alone for the whole class, or * as a wildcard, e.g. --tests '*IT'.
Why does PowerShell need quotes?
PowerShell splits an unquoted argument like -Pversion=1.2.0 at the first dot, so Gradle gets the wrong value. The generated command quotes those arguments for you.
Related tools
All tools- Maven Dependency HelperGenerate and format Maven dependency XML, parse coordinates and build Maven commands.
- Spring Boot Config GeneratorGenerate Spring Boot configuration for PostgreSQL, Redis, Kafka, Actuator, HikariCP and more.
- Java Version ComparatorCompare Java 8, 11, 17, 21 and 25 features and changes.
- Java Stack Trace AnalyzerFind the root cause of a Java stack trace, what it means and how to fix it.
- Java Stack Trace FormatterClean up Java stack traces, highlight application frames and find the root cause.