The gradle command has the following usage:
gradle [option...] [task...]
The command-line options available for the gradle command are listed below:
Shows a help message.
Do not rebuild project dependencies.
Shows additional detail in the task listing. See Section 4.7.2, “Listing tasks”.
Specifies the build file. See Section 4.5, “Selecting which build to execute”.
Specifies the settings file.
Specifies which type of console output to generate.
plain to generate plain text only. This option disables all color and other rich output in the console output.
auto (the default) to enable color and other rich output in the console output when
the build process is attached to a console, or to generate plain text only when not attached to a console.
rich to enable color and other rich output in the console output,
regardless of whether the build process is not attached to a console. When not attached to a console, the build output will use ANSI control
characters to generate the rich output.
Continues task execution after a task failure.
Only relevant projects are configured in this build run. This means faster builds for large multi-projects. See Section 188.8.131.52, “Configuration on demand”.
Sets a system property of the JVM, for example
See Section 11.2, “Gradle properties and system properties”.
Log in debug mode (includes normal stacktrace). See Chapter 22, Logging.
Specifies the Gradle user home directory. The default is the
directory in the user's home directory.
Launches the Gradle GUI. See Chapter 10, Using the Gradle Graphical User Interface.
Specifies an initialization script. See Chapter 42, Initialization Scripts.
Set log level to info. See Chapter 22, Logging.
Runs the build with all task actions disabled. See Section 4.8, “Dry Run”.
Specifies that the build should operate without accessing network resources. See Section 23.9.2, “Command line options to override caching”.
Sets a project property of the root project, for example
-Pmyprop=myvalue. See Section 11.2, “Gradle properties and system properties”.
Specifies the start directory for Gradle. Defaults to current directory. See Section 4.5, “Selecting which build to execute”.
Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use. This option should only be used with decoupled projects (see Section 24.9, “Decoupled Projects”).
Sets the maximum number of workers that Gradle may use. For example
--max-workers=3. The default is the number of processors.
This option replaces
--parallel-threads when used in conjuction with
Profiles build execution time and generates a report in the
directory. See Section 4.7.8, “Profiling a build”.
Specifies the project-specific cache directory. Default value is
.gradle in the root project directory.
Log errors only. See Chapter 22, Logging.
Forces scripts to be recompiled, bypassing caching.
Refresh the state of dependencies. See Section 23.9.2, “Command line options to override caching”.
Specifies that any task optimization is ignored.
Print out the full (very verbose) stacktrace for any exceptions. See Chapter 22, Logging.
Print out the stacktrace also for user exceptions (e.g. compile error). See Chapter 22, Logging.
Enables continuous building - Gradle will automatically re-run when changes are detected.
Don't search in parent directories for a
Prints version info.
Specifies a task to be excluded from execution. See Section 4.2, “Excluding tasks”.
The above information is printed to the console when you execute
Do not use color in the console output. This option has been replaced by the
--console plain option.
Build projects in parallel, using the specified number of executor threads.
This option should only be used with decoupled projects (see Section 24.9, “Decoupled Projects”).
This option has been replaced by
Chapter 6, The Gradle Daemon
contains more information about the daemon.
For example it includes information how to turn on the daemon by default
so that you can avoid using
all the time.
Uses the Gradle daemon to run the build. Starts the daemon if not running or existing daemon busy. Chapter 6, The Gradle Daemon contains more detailed information when new daemon processes are started.
Starts the Gradle daemon in the foreground. Useful for debugging or troubleshooting because you can easily monitor the build execution.
Do not use the Gradle daemon to run the build. Useful occasionally if you have configured Gradle to always run with the daemon by default.
Stops the Gradle daemon if it is running.
You can only stop daemons that were started with
the Gradle version you use when running
The following system properties are available for the gradle command. Note that command-line options take precedence over system properties.
Specifies the Gradle user home directory.
The Section 11.1, “Configuring the build environment via gradle.properties” contains specific information about Gradle configuration available via system properties.
The following environment variables are available for the gradle command. Note that command-line options and system properties take precedence over environment variables.
Specifies command-line arguments to use to start the JVM. This can be useful for setting
the system properties to use for running Gradle. For example you could set
to use the Gradle daemon without needing to use the
option every time you
Section 11.1, “Configuring the build environment via gradle.properties”
contains more information about ways of configuring the daemon
without using environmental variables, e.g. in more maintainable and explicit way.
Specifies the Gradle user home directory (which defaults to “
USER_HOME/.gradle” if not set).
Specifies the JDK installation directory to use.