GRADLE(1)

πŸ’– GRADLE(1) β€” the gradle command line, but make it make sense πŸ’–

okay bestie, welcome to the Gradle Command Line Manual ✨ (that's the manual name, iykyk). This is the gradle page β€” adaptable, fast automation for all πŸ¦‹


🌸 NAME 🌸

gradle β€” adaptable, fast automation for all πŸ’…


✨ SYNOPSIS ✨

gradle [option...] [task...]

like. that's it. that's the whole vibe. options and tasks, go off πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

Real talk first: there's a detailed guide of the command line interface on Gradle's official website. The project itself does not provide a manpage, so maintaining this one is error-prone and costly 😭 (not me being honest about my own job).

Anyway β€” here's the summary of the options. All of them. Every single one. No skipping 🫢

  • -?, -h, --help β€” Shows a help message. your classic cry-for-help button, love that for you πŸ™ˆ
  • -a, --no-rebuild β€” (deprecated 🫠) Do not rebuild project dependencies.
  • --all β€” Shows additional detail in the task listing. See the documentation section LISTING TASKS.
  • -b, --build-file β€” Specifies the build file. See the documentation section SELECTING BUILD.
  • --build-cache β€” (incubating πŸ‘Ά) Enables the Gradle build cache. Gradle will try to reuse outputs from previous builds. it's giving "why redo work when you can not" πŸ’…
  • --no-build-cache β€” (incubating πŸ‘Ά) Disables the Gradle build cache.
  • -c, --settings-file β€” Specifies the settings file.
  • --console β€” Specifies which type of console output to generate. Pick your aesthetic, bestie:
    • Set to plain to generate plain text only. This option disables all color and other rich output in the console output.
    • Set to 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.
    • Set to 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.
    • Set to verbose to enable color and other rich output like the rich, but output more detailed message (task name, output, etc.)
  • --continue β€” Continues task execution after a task failure. it's the "we don't stop, we keep going" energy ✨
  • --configure-on-demand β€” (incubating πŸ‘Ά) Only relevant projects are configured in this build run. This means faster builds for large multi-projects. See the documentation section CONFIGURATION ON DEMAND.
  • --no-configure-on-demand β€” (incubating πŸ‘Ά) Disables the use of configuration on demand.
  • -D, --system-prop β€” Sets a system property of the JVM, for example -Dmyprop=myvalue. See the documentation section GRADLE PROPERTIES AND SYSTEM PROPERTIES.
  • -d, --debug β€” Log in debug mode (includes normal stacktrace). See the documentation section LOGGING.
  • -g, --gradle-user-home β€” Specifies the Gradle user home directory. The default is the .gradle directory in the user's home directory.
  • --include-build β€” Run the build as a composite, including the specified build. See the documentation section COMPOSITE BUILDS.
  • -I, --init-script β€” Specifies an initialization script. See the documentation section INIT SCRIPTS.
  • -i, --info β€” Set log level to info. See the documentation section LOGGING.
  • -m, --dry-run β€” Runs the build with all task actions disabled. See the documentation section DRY RUN.
  • --offline β€” Specifies that the build should operate without accessing network resources. See the documentation section CACHE COMMAND LINE OPTIONS.
  • -P, --project-prop β€” Sets a project property of the root project, for example -Pmyprop=myvalue. See the documentation section GRADLE PROPERTIES AND SYSTEM PROPERTIES.
  • -p, --project-dir β€” Specifies the start directory for Gradle. Defaults to current directory. See the documentation section SELECTING BUILD.
  • --parallel β€” (incubating πŸ‘Ά) 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 the documentation section DECOUPLED PROJECTS). For limitations of this option please see the documentation section PARALLEL EXECUTION.
  • --no-parallel β€” (incubating πŸ‘Ά) Disables parallel execution to build projects.
  • --max-workers β€” (incubating πŸ‘Ά) Sets the maximum number of workers that Gradle may use. For example --max-workers=3. The default is the number of processors.
  • --profile β€” Profiles build execution time and generates a report in the buildDir /reports/profile directory. See the documentation section PROFILING BUILD.
  • --project-cache-dir β€” Specifies the project-specific cache directory. Default value is .gradle in the root project directory.
  • -q, --quiet β€” Log errors only. See the documentation section LOGGING.
  • --recompile-scripts β€” (deprecated 🫠) Forces scripts to be recompiled, bypassing caching. This option has been deprecated and is scheduled to be removed Gradle 5.0. You should avoid using it.
  • --refresh-dependencies β€” Refresh the state of dependencies. See the documentation section CACHE COMMAND LINE OPTIONS.
  • --rerun-tasks β€” Specifies that any task optimization is ignored.
  • -S, --full-stacktrace β€” Print out the full (very verbose) stacktrace for any exceptions. See the documentation section LOGGING.
  • -s, --stacktrace β€” Print out the stacktrace also for user exceptions (e.g. compile error). See the documentation section LOGGING.
  • --scan β€” (incubating πŸ‘Ά) Creates a build scan. Gradle will auto-apply the build scan plugin with a compatible version. For more information about build scans, please visit <https://gradle.com/build-scans>.
  • --no-scan β€” (incubating πŸ‘Ά) Disables the creation of a build scan. For more information about build scans, please visit <https://gradle.com/build-scans>.
  • -t, --continuous β€” (incubating πŸ‘Ά) Enables continuous building - Gradle will automatically re-run when changes are detected. it's giving "I'll just keep watching, bestie" πŸ‘€
  • -u, --no-search-upward β€” Don't search in parent directories for a settings.gradle file.
  • -v, --version β€” Prints version info.
  • -w, --warn β€” Set log level to warn. See the documentation section LOGGING
  • -x, --exclude-task β€” Specifies a task to be excluded from execution. See the documentation section EXCLUDING TASKS FROM THE COMMAND LINE.
✨ PSA: the above information is printed to the console when you execute gradle -h. so if you forget literally everything, just ask Gradle herself πŸ’–

🧚 DAEMON COMMAND-LINE OPTIONS 🧚

The documentation section 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 --daemon all the time. (main character energy: set it once, never think about it again πŸ‘‘)

  • --daemon β€” Uses the Gradle daemon to run the build. Starts the daemon if not running or existing daemon busy. the documentation section GRADLE DAEMON contains more detailed information when new daemon processes are started.
  • --no-daemon β€” Does not use the Gradle daemon to run the build.
  • --foreground β€” Starts the Gradle daemon in the foreground. Useful for debugging or troubleshooting because you can easily monitor the build execution.
  • --no-daemon β€” 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.
πŸ’€ not the manpage listing --no-daemon twice with two different descriptions. I'm not fixing it, I'm not merging them, I'm just reporting the lore fr fr. Both are here, both are real, we respect the original.
  • --status β€” List running and recently stopped Gradle daemons. Only displays daemons of the same Gradle version.
  • --stop β€” Stops the Gradle daemon if it is running. You can only stop daemons that were started with the Gradle version you use when running --stop.

🌈 SYSTEM PROPERTIES 🌈

The following system properties are available for the gradle command. Note that command-line options take precedence over system properties. πŸ‘‘ (options stay winning)

  • gradle.user.home β€” Specifies the Gradle user home directory.

The documentation section GRADLE CONFIGURATION PROPERTIES contains specific information about Gradle configuration available via system properties.


πŸ“ 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. (yes bestie, the hierarchy is real: options > system properties > env vars πŸ’…)

  • 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. the documentation section GRADLE CONFIGURATION 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.

πŸ¦‹ SEE ALSO πŸ¦‹

<https://docs.gradle.org/current/userguide/command_line_interface.html> β€” go read the actual guide, she's iconic ✨


πŸ’œ AUTHORS πŸ’œ

Gradle developers 🫢


okay that's the whole page, no cap, every flag accounted for πŸ’– this was Gradle 4.4.1, dated 2025-01-18, and it lives under the name GRADLE(1) in the Gradle Command Line Manual. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from