IntelliJ IDEA 2019.1 Help

Import Project from Gradle. Page 1

Item

Description

Gradle project

Specify the address of the build.gradle file of the project you want to import. Type the path manually, or click the browse button browseButton and locate the desired file in the file chooser dialog.

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 (not configured for the current project)

Select this option to use Gradle wrapper. Using Gradle wrapper lets you get automatic Gradle download for the build. It also lets you build with the precise Gradle version.

Use customizable gradle wrapper

Select this option to configure a Gradle wrapper inside your build.gradle file. In this case IntelliJ IDEA ensures that the configured customizable wrapper settings are used for working with Gradle.

Use local gradle distribution

Select this option to run local build scripts.

Gradle home

By default, IntelliJ IDEA displays the path to the Gradle installation, as defined in the GRADLE_HOME environment variable, or specified as the Gradle home project setting.

If the path is unknown, or you want to use a different Gradle installation, click the browse button browseButton and locate the desired directory in the path chooser dialog.

Project format

Select the format in which you want to store your project. For the details on the two available formats, refer to the Projects section.

Global Gradle Settings

Use this area to set global Gradle 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: 13 May 2019

See Also

Reference:

Language and Framework-Specific Guidelines: