IntelliJ IDEA with multiple gradle subprojects

后端 未结 2 1095
情歌与酒
情歌与酒 2020-12-31 04:12

I\'m working on multiple Gradle projects with internal and external dependencies, and so far I am happy that thanks to Gradle\'s dependency management I can modify a library

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-31 05:11

    Currently in IntelliJ IDEA 2019.2 you can add the gradle subprojects like so

    1. Open Gradle Tool Window via View > Tool Windows > Gradle menu
    2. Click on "Link Gradle Project" button (the plus sign)
    3. Select the build.gradle file corresponding to the subproject
    4. Go to File > Project Structure > Modules > NameOfSubproject
    5. Navigate to main/java and click on Mark as: Sources
    6. Mark the main/resources as Resources
    7. 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

提交回复
热议问题