IntelliJ IDEA with multiple gradle subprojects
If you want to open all projects in a single IDEA window, you'll have to aggregate them into a multi-project build, at least until IDEA 13 hits the market. Before IDEA 13, it's better to use Gradle's IDEA integration. Once you have a multi-project build, all you need to do is to add allprojects { apply plugin: "idea" }
to the root build script, run gradle (cleanIdea) idea
, then open the generated IDEA project.
Currently in IntelliJ IDEA 2019.2 you can add the gradle subprojects like so
- Open Gradle Tool Window via View > Tool Windows > Gradle menu
- Click on "Link Gradle Project" button (the plus sign)
- Select the build.gradle file corresponding to the subproject
- Go to File > Project Structure > Modules > NameOfSubproject
- Navigate to main/java and click on Mark as: Sources
- Mark the main/resources as Resources
- Restart IntelliJ IDEA
The sources of the subproject will be recognized by IntelliJ and you can use Navigate Class action for the classes in the subproject