IntelliJ IDEA 2017.3 Help

Gradle settings

File | Settings | Build, Execution, Deployment | Build Tools | Gradle


Use this page to configure Gradle project settings.

ItemDescription
Linked Gradle projectsThis area contains the list of registered Gradle projects that are linked to your IntelliJ IDEA project.
Project-level settingsThis area contains settings for your Gradle project. You can select from the following options:
  • Use auto-import - select this checkbox to resolve all the changes made to the Gradle project automatically every time you refresh your project.
  • Create directories for empty content roots automatically - select this option to add a src directory to your project automatically when you import a project from Gradle model.
  • Create separate module per source set - select this checkbox to use the source set feature in resolving your Gradle projects.
  • Use default gradle wrapper (recommended) - select this checkbox to use Gradle Wrapper. You can use this option when you have generated or checked out wrapper files in the default location.
    gradle wrapper default
  • Use gradle wrapper task configuration - select this checkbox to customize your Gradle Wrapper. You can use this option if you do not have wrapper files on your disk yet or if you use a different location for them. In this case IntelliJ IDEA refers to the Gradle wrapper task definition and generates or updates the files based on the task configuration. This option can be useful when you don't want to check in binary wrapper files or reuse the same wrapper files for several projects.
    gradle wrapper custom
  • Use local gradle distribution - select this option to run local build scripts.
  • Gradle home - in this text field, specify the fully qualified path to your Gradle installation.

    If Gradle location has been defined by the environment variables GRADLE_HOME or PATH, then IntelliJ IDEA deduces this location, and suggests this path as the default value.

    If Gradle location has not been deduced from the environment variables, specify it manually, or click the Browse button, and select the desired directory in the dialog that opens. Note that the value entered in this field takes preference over the environment variables.

  • Gradle JVM - use this drop-down list to select a JVM for running Gradle projects. The default is set to your project JDK.
Global Gradle settingsThis area contains options for Gradle global settings. You can select from the following options:
  • Offline work - use this checkbox to work with Gradle in the offline mode. In this case Gradle will use dependencies from the cache. Gradle will not attempt to access the network to perform dependency resolution. If required dependencies are not present in the dependencies' cache, a build execution will fail.
  • Service directory path - use this field to override the default Gradle home location directory.
  • Gradle VM options - use this field to specify VM options for your Gradle project.

    When specifying JVM options, follow these rules:

    • Use spaces to separate individual options, for example, -client -ea -Xmx1024m.
    • If an option includes spaces, enclose the spaces or the argument that contains spaces in double quotes, for example, some" "arg or "some arg".
    • If an option includes double quotes (as part of the argument), escape the double quotes using backslashes, for example, -Dmy.prop=\"quoted_value\".
    • You can pass environment variable values to custom Java properties. For example, if you define a variable MY_ENV_VAR, you can pass it to the foo property as follows:
      -Dfoo=${MY_ENV_VAR}
Last modified: 6 March 2018

See Also

Language and Framework-Specific Guidelines: