IntelliJ IDEA 2016.3 Help

Working with Gradle Projects

IntelliJ IDEA lets you link a Gradle project to an existing IntelliJ IDEA project.

When a project is created by importing from Gradle model, this link is established automatically and the Gradle tool window is enabled.

If you open your project with a valid buid.gradle file using File | Open command, the Gradle tool window will be disabled.

If an IntelliJ IDEA project is not linked to a Gradle project, then the Gradle tool window is also disabled.
In this case, IntelliJ IDEA displays a message with a link that quickly lets you import your gradle project and enable the Gradle tool window.
If the Gradle tool window is active then you have at least one Gradle project linked.

It is also possible to open, detach or refresh a linked Gradle project. This is done in the Gradle tool window.

Linking a Gradle project to IntelliJ IDEA project

  1. Open Gradle tool window.
  2. In the Gradle tool window, click /help/img/idea/2016.3/new.png to attach a gradle project.
  3. In the dialog box that opens, select the desired build.gradle file, and click OK. Now as there is a linked Gradle project, the Gradle tool window shows the toolbar and tree view of Gradle entities.

Opening a linked Gradle project

  1. In the Gradle tool window, right-click on the linked project.
  2. From the context menu select /help/img/idea/2016.3/icon_gradle.png.

    IntelliJ IDEA navigates to the appropriate Gradle configuration file and the related build.gradle file opens in the editor.

Detaching a linke Gradle project

  1. In the Gradle tool window, under All tasks right-click on the linked project.
  2. From the context menu, select /help/img/idea/2016.3/delete.png. Alternatively, you can select the linked project and click /help/img/idea/2016.3/delete.png on the Gradle tool bar.
  3. In the Import Gradle Project pop-up window, clear the check box if you do not want to delete the IntelliJ IDEA project as well.
  4. Click OK.

    The Gradle project is detached from the IntelliJ IDEA project and is not synchronized any more.

Refreshing a linked Gradle project

  1. In the Gradle tool window, right-click on the linked project.
  2. From the context menu, select /help/img/idea/2016.3/refresh.png.

    The IntelliJ IDEA synchronizes all linked projects.

See Also

```

Concepts:

Last modified: 21 March 2017