Beside its scripts, a Gradle build keeps three data files with fixed keys.
Sources: the Gradle User Manual (current, Gradle 9) chapters
Configuring the Build Environment
(locations, precedence and the Gradle properties reference),
Version Catalogs and
Gradle Wrapper.
The manual names but does not describe distributionBase,
distributionPath, zipStoreBase and
zipStorePath; their values below are those written in a
gradle-wrapper.properties that Gradle generated.
gradle.properties
A properties file of key=value lines, in the project’s root folder, in
the Gradle user home (GRADLE_USER_HOME) or in the Gradle installation
(GRADLE_HOME). The user home’s file takes precedence over the project’s,
and both over the installation’s; command-line options override them all. Keys with
no prefix are project properties, read in scripts with
providers.gradleProperty(). A key systemProp.x sets the JVM
system property x, and only the root project’s file is checked for
these. Gradle’s own keys:
| Key | Values | Default | Meaning |
|---|---|---|---|
org.gradle.caching | boolean | false | Reuse task outputs through the build cache. |
org.gradle.caching.debug | boolean | false | Log input hashes and build cache keys. |
org.gradle.configuration-cache | boolean | false | Reuse the configuration phase’s result. |
org.gradle.configureondemand | boolean | false | Configure only the projects needed (incubating). |
org.gradle.console | auto, plain, colored, rich, verbose | depends on the terminal | Console output style. |
org.gradle.console.interactive | boolean | true | false skips prompts and takes defaults (incubating). |
org.gradle.continue | boolean | false | Carry on with other tasks after a failure. |
org.gradle.daemon | boolean | true | Run the build in the Gradle Daemon. |
org.gradle.daemon.idletimeout | milliseconds | 10800000 (3 hours) | Stop an idle daemon after this long. |
org.gradle.debug | boolean | false | Listen for a debugger on port 5005 and wait for it. |
org.gradle.java.home | JDK path | from JAVA_HOME or java on the path | JDK that runs the build. |
org.gradle.java.installations.auto-detect | boolean | true | Find installed JDKs for toolchains. |
org.gradle.java.installations.auto-download | boolean | true | Download JDKs for toolchains. |
org.gradle.java.installations.paths | comma-separated folders | empty | Extra places to look for JDKs. |
org.gradle.java.installations.fromEnv | comma-separated variable names | empty | Environment variables that point at JDKs. |
org.gradle.jvmargs | JVM arguments | -Xmx512m "-XX:MaxMetaspaceSize=384m" | Arguments for the daemon’s JVM. |
org.gradle.logging.level | quiet, warn, lifecycle, info, debug | lifecycle | Log level, any case. |
org.gradle.parallel | boolean | false | Run projects in parallel, up to org.gradle.workers.max. |
org.gradle.priority | low, normal | normal | Scheduling priority of the daemon. |
org.gradle.projectcachedir | folder | .gradle in the root project | Per-build cache folder. |
org.gradle.problems.report | boolean | true | Write build/reports/problems-report.html. |
org.gradle.tooling.parallel | boolean | value of org.gradle.parallel | Run tooling model builders in parallel (Gradle 9.4). |
org.gradle.isolated-projects | boolean | false | Configure projects in parallel, in isolation; implies the configuration cache (Gradle 9.7). |
org.gradle.isolated-projects.diagnostics | boolean | false | Configure one project at a time to show isolation problems (Gradle 9.7). |
org.gradle.isolated-projects.dangerously-ignore-problems | boolean | false | Report isolation problems without failing; outputs may be wrong (Gradle 9.7). |
org.gradle.vfs.verbose | boolean | false | Verbose logging of file-system watching. |
org.gradle.vfs.watch | boolean | true where supported | Keep file-system state between builds. |
org.gradle.warning.mode | all, fail, summary, none | summary | How deprecation warnings are shown. |
org.gradle.workers.max | integer | number of processors | Most worker processes at once. |
Version catalog: libs.versions.toml
A TOML file, by default
gradle/libs.versions.toml, imported automatically; its entries are used
in scripts as libs.<alias>.
| Table | Entries |
|---|---|
[versions] | Named versions: a string or a rich version table. |
[libraries] | Aliases for libraries: a string "group:name:version", or a table with module = "group:name" (or group and name) and version or version.ref. |
[bundles] | Named arrays of library aliases, added together with one line. |
[plugins] | Aliases for plugins: id and version or version.ref. |
| Rich version key | Meaning |
|---|---|
require | The version needed, which may be upgraded by conflict resolution. |
strictly | Only this version or range; overrides others. |
prefer | Used when nothing stronger is asked for. |
reject | Versions not accepted. |
rejectAll | Boolean: reject every version. |
An alias is made of words separated by - or _; each
separator becomes a dot in the script, so ktor-client-core is used as
libs.ktor.client.core.
[versions]
junit = "5.10.0"
[libraries]
guava = "com.google.guava:guava:33.0.0-jre"
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
[plugins]
example = { id = "com.example.plugin", version = "1.0" }
Wrapper
The wrapper is four files committed with the project: gradlew (shell
script for macOS and Linux), gradlew.bat (Windows),
gradle/wrapper/gradle-wrapper.jar (the code that downloads Gradle) and
gradle/wrapper/gradle-wrapper.properties:
| Key | Default | Meaning |
|---|---|---|
distributionUrl | the version that ran gradle wrapper, -bin type | Location of the Gradle distribution ZIP (server, type and version), e.g. https\://services.gradle.org/distributions/gradle-2.8-all.zip (from a generated file). |
distributionBase | GRADLE_USER_HOME | Base folder for distributionPath. |
distributionPath | wrapper/dists | Where unpacked distributions are kept, under the base. |
zipStoreBase | GRADLE_USER_HOME | Base for zipStorePath. |
zipStorePath | wrapper/dists | Where downloaded ZIPs are kept. |
networkTimeout | 10000 | Download timeout in milliseconds. |
validateDistributionUrl | true | Check that the URL works before writing it. |
retries | 0 | Download retries. |
retryBackOffMs | 500 | First wait between retries, doubled after each failure. |
distributionSha256Sum | none | SHA-256 that the downloaded ZIP must match. |