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
groupIdof the new project, which will be added to the
- ArtifactId - specify
artifactIdof the new project.
- Version - specify
versionof the new project, which will be added to the
- 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
Importing Project from Gradle Model
- On the main menu, select , from the dialog that opens select
build.gradlefile 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.
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.