Gradle Command Line

From NovaOrdis Knowledge Base
Jump to navigation Jump to search



In case of a multi-project, Gradle command can be executed from the root of the project or from any sub-projects.

Some command line options have the same effect as setting corresponding properties or environment variables. When a command line option is present, it has precedence over the equivalent properties or environment variables. More details in:

Gradle Variables and Properties

Command Line Flags


In-line help.

gradle --help


./gradlew --version
gradle --version


Only warning and error category output is displayed. The logger "quiet" category can be accessed with:

logger.quiet "will be displayed even in quiet mode"

Also see:

Gradle Logging


Executes a dry run: run the builds with all task actions disabled.


When executed with -i, Gradle displays the tasks that are executed, in the order in which they are executed. Additionally, -m|--dry-run can be used to simulate the execution without actually performing the task actions.

Also see:

Gradle Logging


Also see:

Gradle Logging

-P<property-name>=<property-value> Project Properties


Gradle Project Coordinates, State and Configured Properties

-D<property-name>=<property-value> System Properties


Gradle System Properties


Execute without the task following -x. For example, if I want to execute a build without tests:

gradle build -x test

or if I want to publish without running the javadoc task:

gradle build publish -x javadoc



Also see Ordering Tasks.



Gradle Daemon



Gradle Daemon Operations | Stop



Gradle Daemon Operations | Status


Gradle Dependencies and Dependency Configurations | Forced Cache Update


Disable Incremental Builds

Built-in Tasks