Command LIne - pford68/gradle-examples GitHub Wiki

I won't re-list all of the options, properties, and variables here, see Gradle Command Line for the complete list.

Options

The list of options includes optiosn for setting log levels, debug mode, system properties, dry-runs, project directories, threads, quiet/verbose, Gradle GUI, etc.

For example:

  • -d, --debug for debug mode
  • -P, --project-prop for setting a project property
  • -D, --system-prop for setting a system property
  • -i, --info for setting the log level to info

Daemon Options

Among other options, you can specify running without a daemon, which sometimes is necessary in order to run clean up tasks, deleting resources locked by the daemon.

  • --no-daemon runs without daemon

Environment Variables

The following environment variables are available for the gradle command. Note that command-line options and system properties take precedence over environment variables.

GRADLE_OPTS

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 GRADLE_OPTS="-Dorg.gradle.daemon=true" to use the Gradle daemon without needing to use the --daemon option every time you run Gradle. Section 12.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.

GRADLE_USER_HOME

Specifies the Gradle user home directory (which defaults to “USER_HOME/.gradle” if not set).

JAVA_HOME

Specifies the JDK installation directory to use.

References