An overview of the

Gradle and its behavior can be configured in one of four ways, in order of importance, with the first taking precedence over the last

Configure command line parameters

Gradle (–build-cache)

Configuring System Attributes

In gradle. The properties in the configuration system at the beginning of attributes (systemProp.http.proxyHost=somehost.org)

Configure Gradle properties

Configure the properties in gradle.properties (org.gradle.Caching =true)

Configuring environment Variables

Setting environment variables (GRADLE_OPTS)

Configure Gradle properties

Gradle.properties finds the priority

Gradle properties are configured in the gradle.properties file. There may be multiple gradle.properties in a project, but whichever is the first one found at build time?

  1. Gradle.properties specified by the command line argument
  2. In GRADLE_USER_HOME gradle. The properties
  3. Gradle.properties in the project root directory
  4. Gradle.properties in the root directory of Gradle installation

Gradle configurable properties

  • org.gradle.caching=(true,false)

Whether to enable output caching for tasks. After this function is enabled, results previously generated by tasks are used to speed up construction

  • org.gradle.caching.debug=(true,false)

When enabled, cache-related information is printed to the console

  • org.gradle.configureondemand=(true,false)

When enabled, Gradle is configured on demand for projects that need it

  • org.gradle.console=(auto,plain,rich,verbose)

Configure console output levels and colors, etc

  • org.gradle.daemon=(true,false)

Gradle Daemon Is a Daemon that exists in the background by default

  • org.gradle.daemon.idletimeout=(# of idle millis)

Set a timeout for Gradle Daemon, default 10800000 ms (3 hours)

  • org.gradle.debug=(true,false)

Whether to allow remote debugging, listening on port 5005 when enabled

  • org.gradle.java.home=(path to JDK home)

Specify JavaHome for Gradle

  • org.gradle.jvmargs=(JVM arguments)

Set Jvm memory parameters for Gradle Daemon

  • org.gradle.logging.level=(quiet,warn,lifecycle,info,debug)

Configure the Gradle Log display level. Lifecycle is the default

  • org.gradle.parallel=(true,false)

Whether to allow multiple threads to execute tasks concurrently

  • org.gradle.priority=(low,normal).

Set Gradle Daemon scheduling priority to normal by default

  • org.gradle.vfs.verbose=(true,false)

Configure the Log display level for the monitored file system

  • org.gradle.vfs.watch=(true,false)

Whether to monitor file system changes before and after build

  • org.gradle.warning.mode=(all,fail,summary,none)

Set the mode and level of warning display

  • org.gradle.workers.max=(max # of worker processes)

Maximum number of concurrent threads when Gradle is built. Default is the number of core processes on the current CPU

System configurable properties

  • gradle.wrapperUser=(myuser)

You need to set a user name when downloading Gradle

  • gradle.wrapperPassword=(mypassword)

You need to set a password to download Gradle

  • gradle.user.home=(path to directory)

Gradle user folder address

  • https.protocols

Set TLS versions TLSv1.2 and TLSv1.3

The environment variable

  • GRADLE_OPTS

Used to configure parameters for use by the JVM

  • GRADLE_USER_HOME

The user folder used to specify Gradle, default $USER_HOME/.gradle

  • JAVA_HOME

Specify where the JDK is located

The JVM parameter

  • org.gradle.jvmargs

Configure some JVM-related parameters, such as:

org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
-Dfile.encoding=UTF-8
Copy the code