IntelliJ IDEA 2016.3 Help

Getting Started with Gradle

IntelliJ IDEA supports Gradle plugin version 1.8 and later and lets you take full advantage of the Gradle integration.

Creating Gradle Project

  1. Open Project Wizard, in the left-hand pane select Gradle.
  2. In the right-hand pane, specify the following options:
    • Project SDK - specify your project SDK(JDK).
      If the necessary JDK is already defined in IntelliJ IDEA, select it from the list. Otherwise, click New and select the installation folder of the desired JDK.
    • Additional Libraries and Frameworks - use this area to select an additional framework or a library for your Gradle project.
    /help/img/idea/2016.3/gradle_new_project.png
    Click Next.
  3. On the next page of the wizard, specify the following settings:
    • GroupId - specify groupId of the new project, which will be added to the build.gradle file.
    • ArtifactId - specify artifactId of the new project.
    • Version - specify version of the new project, which will be added to the build.gradle file.
    /help/img/idea/2016.3/gradle_groupId.png
    Click Next.
  4. On the next page of the wizard, specify the Gradle settings and click Next.
    /help/img/idea/2016.3/gradle_settings_page.png
  5. Specify the name and location settings. For more information, see Project Name and Location or Module Name and Location. Click Finish.
    /help/img/idea/2016.3/gradle_project_info_page.png

IntelliJ IDEA creates a project with build.gradle file.

Importing Project from Gradle Model

  1. On the main menu, select File | Open, from the dialog that opens select build.gradle file and click OK.
    IntelliJ IDEA will import Gradle project even if the project was not opened or imported before.
    Alternatively, you can select File | New | Project from Existing Sources and from the dialog that opens select the Gradle project that you want to import.
  2. On the next page, select the model from which you want to import and click Next. If IntelliJ IDEA guessed what you are importing, then this page will be skipped.
  3. On the next page of the wizard, specify the Gradle project settings and global Gradle settings and click Finish.
    /help/img/idea/2016.3/gradle_import_project_page.png

If you import a multi-module project, IntelliJ IDEA displays the Project Data to Import dialog where you can select modules that you want to include in the project.

/help/img/idea/2016.3/gradle_project_data_to_import.png

Exploring Gradle Project Structure

IntelliJ IDEA lets you view your Gradle project from the two following points:

/help/img/idea/2016.3/gradle_project_structure.png

You can make changes to the structure of the original Gradle project and to the resulting IntelliJ IDEA project, synchronize structures of the two projects, and explore differences.

Working with Gradle Tool Window

IntelliJ IDEA lets you perform the following actions in the Gradle tool window:

Last modified: 29 November 2016