Skip to content
Shrake DevTools
  • JSON FormatterData & Format
  • JSON ValidatorData & Format
  • JSON MinifierData & Format
  • JSON ↔ YAML ConverterData & Format
  • XML FormatterData & Format
  • Base64 Encoder / DecoderData & Format
  • URL Encoder / DecoderData & Format
  • JWT InspectorData & Format
↑ ↓ to navigate↵ to openEsc to close

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

  1. Pick your shell, and whether the project has the Gradle Wrapper (it usually does).
  2. Tick the tasks to run, and optionally the subprojects, tests to filter and tasks to exclude.
  3. Add flags, then copy the command. Each part is explained below it, and the flags worth keeping are shown as gradle.properties lines.

Tips

  • Task options follow their task: --tests belongs after test, and --args after bootRun. To filter the tests build runs, the command names test --tests … first.
  • Subprojects: :api:test runs only the api project's tests; plain test runs 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.properties so 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.