The gradle command has the following usage:
gradle [option...] [task...]
The command-line options available for the gradle command are listed below:
-?, -h, --helpShows a help message.
-C, --cacheSpecifies how compiled build scripts should be cached. Possible values are:
rebuild or on. Default value is
on. See Section 12.7, “Caching”.
-D, --system-propSets a system property of the JVM, for example -Dmyprop=myvalue.
See Section 12.2, “Gradle properties and system properties”.
-I, --init-scriptSpecifies an initialization script. See Chapter 46, Initialization Scripts.
-P, --project-propSets a project property of the root project, for example
-Pmyprop=myvalue. See Section 12.2, “Gradle properties and system properties”.
-S, --full-stacktracePrint out the full (very verbose) stacktrace for any exceptions. See Chapter 16, Logging.
-a, --no-rebuildDo not rebuild project dependencies.
--allShows additional detail in the task listing. See Section 10.5.2, “Listing tasks”.
-b, --build-fileSpecifies the build file. See Section 10.4, “Selecting which build to execute”.
-c, --settings-fileSpecifies the settings file.
-d, --debugLog in debug mode (includes normal stacktrace). See Chapter 16, Logging.
-e, --embeddedSpecify an embedded build script.
-g, --gradle-user-homeSpecifies the Gradle user home directory. The default is the .gradle
directory in the user's home directory.
--guiLaunches the Gradle GUI. See Chapter 11, Using the Gradle Graphical User Interface.
-i, --infoSet log level to info. See Chapter 16, Logging.
-m, --dry-runRuns the build with all task actions disabled. See Section 10.6, “Dry Run”.
--no-colorDo not use color in the console output.
-p, --project-dirSpecifies the start directory for Gradle. Defaults to current directory. See Section 10.4, “Selecting which build to execute”.
--profileProfiles build execution time and generates a report in the
directory. See Section 10.5.5, “Profiling a build”.
buildDir/reports/profile
--project-cache-dirSpecifies the project-specific cache directory. Default value is .gradle in the root project directory. See Section 12.7, “Caching”.
-q, --quietLog errors only. See Chapter 16, Logging.
-s, --stacktracePrint out the stacktrace also for user exceptions (e.g. compile error). See Chapter 16, Logging.
-u, --no-search-upwardsDon't search in parent directories for a settings.gradle file.
-v, --versionPrints version info.
-x, --exclude-taskSpecifies a task to be excluded from execution. See Section 10.2, “Excluding tasks”.
The above information is printed to the console when you execute gradle -h.
The following options are deprecated and will be removed in a future version of Gradle:
-n, --dependencies(deprecated) Show list of all project dependencies. You should use gradle dependencies
instead. See Section 10.5.3, “Listing project dependencies”.
-r, --properties(deprecated) Show list of all available project properties. You should use gradle properties
instead. See Section 10.5.4, “Listing project properties”.
-t, --tasks(deprecated) Show list of available tasks. You should use gradle tasks
instead. See Section 10.5.2, “Listing tasks”.
The following options are experimental:
--continueContinues task execution after a task failure.
--daemonUses the Gradle daemon to run the build. Starts the daemon if not running.
--foregroundStarts the Gradle daemon in the foreground.
--no-daemonDo not use the Gradle daemon to run the build.
--stopStops the Gradle daemon if it is running.
The following system properties are available for the gradle command. Note that command-line options take precedence over system properties.
gradle.user.homeSpecifies the Gradle user home directory.
org.gradle.daemonWhen set to true, use the Gradle daemon to run the build.
The following environment variables are available for the gradle command. Note that command-line options and system properties take precedence over environment variables.
GRADLE_OPTSSpecifies 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 GRADLE_OPTS="-Dorg.gradle.daemon=true"
to use the Gradle daemon without needing to use the --daemon option every time you
run Gradle.
GRADLE_USER_HOMESpecifies the Gradle user home directory.