Subcommands16 subcommands
gradle build
Compute all outputs
gradle run
Run applications
gradle check
Run all checks
gradle clean
Clear the contents of the build directory
gradle projects
List of all sub-projects
gradle tasks
List of main tasks of the selected project
gradle help
Display task usage information
gradle dependencies
Gives you a list of the dependencies of the selected project, broken down by configuration
gradle buildEnvironment
Visualises the buildscript dependencies of the selected project
gradle dependencyInsight
Gives you an insight into a particular dependency (or dependencies) that match specified input
gradle properties
Gives you a list of the properties of the selected project
gradle --status
(Standalone command) List running and recently stopped Gradle daemons. Only displays daemons of the same Gradle version
gradle --stop
(Standalone command) Stop all Gradle Daemons of the same version
gradle init
Create new Gradle builds, with new or existing projects
gradle wrapper
Generates a script, gradlew, that invokes a declared version of Gradle, downloading it beforehand if necessary
gradle test
Run a test task
OptionsOn gradle itself
-?-h--help
Shows a help message with all available CLI options
-v--version
Prints Gradle, Groovy, Ant, JVM, and operating system version information
-S--full-stacktrace
Print out the full (very verbose) stacktrace for any exceptions
-s--stacktrace
Print out the stacktrace also for user exceptions (e.g. compile error)
--scan
Create a build scan with fine-grained information about all aspects of your Gradle build
-Dorg.gradle.debug
Debug Gradle client (non-Daemon) process. Gradle will wait for you to attach a debugger at localhost:5005 by default
-Dorg.gradle.daemon.debug
Debug Gradle Daemon process
--build-cache
Toggles the Gradle build cache. Gradle will try to reuse outputs from previous builds. Default is off
--no-build-cache
Toggles the Gradle build cache. Gradle will try to reuse outputs from previous builds. Default is off
--configure-on-demand
Toggles Configure-on-demand. Only relevant projects are configured in this build run. Default is off
--no-configure-on-demand
Toggles Configure-on-demand. Only relevant projects are configured in this build run. Default is off
--max-workers
Sets maximum number of workers that Gradle may use. Default is number of processors <number>
--parallel
Build projects in parallel. For limitations of this option, see Parallel Project Execution. Default is off
--no-parallel
Disables --parallel
--priority
Specifies the scheduling priority for the Gradle daemon and all processes launched by it <priority>
--profile
Generates a high-level performance report in the $buildDir/reports/profile directory. --scan is preferred
--scan
Generate a build scan with detailed performance diagnostics
--watch-fs
Toggles watching the file system. When enabled Gradle re-uses information it collects about the file system between builds. Enabled by default on operating systems where Gradle supports this feature
--no-watch-fs
Toggles watching the file system. When enabled Gradle re-uses information it collects about the file system between builds. Enabled by default on operating systems where Gradle supports this feature
--daemon
Use the Gradle Daemon to run the build. Starts the daemon if not running or existing daemon busy. Default is on
--no-daemon
Disables --daemon
--foreground
Starts the Gradle Daemon in a foreground process
-Dorg.gradle.daemon.idletimeout
Gradle Daemon will stop itself after this number of milliseconds of idle time <milliseconds>
-Dorg.gradle.logging.level
Set logging level via Gradle properties <level>
-w--warn
Set log level to warn
-i--info
Set log level to info
-d--debug
Log in debug mode (includes normal stacktrace)
-Dorg.gradle.console
Specify console mode via Gradle properties <mode>
--console
Specifies which type of console output to generate <mode>
-Dorg.gradle.warning.mode
Specify warning mode via Gradle properties <mode>
--warning-mode
Specifies how to log warning <mode>
--include-build
Run the build as a composite, including the specified build
--offline
Specifies that the build should operate without accessing network resources
--refresh-dependencies
Refresh the state of dependencies
--dry-run
Run Gradle with all task actions disabled. Use this to show which task would have executed
--write-locks
Indicates that all resolved configurations that are lockable should have their lock state persisted
--update-locks
Indicates that versions for the specified modules have to be updated in the lock file <group:name>
--no-rebuild
Do not rebuild project dependencies. Useful for debugging and fine-tuning buildSrc, but can lead to wrong results. Use with caution
-b--build-file
Specifies the build file. For example: gradle --build-file=foo.gradle <file>
-c--settings-file
Specifies the settings file. For example: gradle --settings-file=somewhere/else/settings.gradle <file>
-g--gradle-user-home
Specifies the Gradle user home directory. The default is the .gradle directory in the user’s home directory <directory>
-p--project-dir
Specifies the start directory for Gradle <directory>
--project-cache-dir
Specifies the project-specific cache directory. Default value is .gradle in the root project directory <directory>
-D--system-prop
Sets a system property of the JVM, for example -Dmyprop=myvalue <system property>
-I--init-script
Specifies an initialization script
-P--project-prop
Sets a project property of the root project, for example -Pmyprop=myvalue <system property>
-Dorg.gradle.jvmargs
Set JVM arguments <arguments>
-Dorg.gradle.java.home
Set JDK home dir <directory>