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
- Importing Project from Gradle Model
- Exploring Gradle Project Structure
- Working with Gradle Tool Window
Creating Gradle Project
- Open Project Wizard, in the left-hand pane select Gradle.
- 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.
-
Project SDK - specify your project SDK(JDK).
- On the next page of the wizard, specify the following settings:
- GroupId - specify
groupId
of the new project, which will be added to thebuild.gradle
file. - ArtifactId - specify
artifactId
of the new project. - Version - specify
version
of the new project, which will be added to thebuild.gradle
file.
- GroupId - specify
- On the next page of the wizard, specify the Gradle settings and click Next.
- Specify the name and location settings. For more information, see Project Name and Location or Module Name and Location. Click Finish.
IntelliJ IDEA creates a project with build.gradle
file.
Importing Project from Gradle Model
- On the main menu, select , 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 and from the dialog that opens select the Gradle project that you want to import. - 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.
- On the next page of the wizard, specify the Gradle project settings and global Gradle settings and click Finish.
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.
Exploring Gradle Project Structure
IntelliJ IDEA lets you view your Gradle project from the two following points:
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:
- run, debug or create the Run/Debug configuration for Gradle tasks
- sync your projects
- add and remove linked projects If you have a multi-module project, IntelliJ IDEA displays the Import Gradle Projects dialog where you can select modules that you want to remove from IntelliJ IDEA project.
Last modified: 21 March 2017