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 project without affecting every application that uses the library.
When I need to modify a library project and test it using an application project that uses it, I need to do the following,
build.properties
to refer to the new version of library projectSo it became quite combersome now. Can I configure IntelliJ IDEA so that
pom.xml
. Sadly IntelliJ's JetGradle plugin doesn't seem to understand Gradle subprojects.build.properties
's dependencies are my subprojects, read dependency from local snapshot, otherwise download them from the Gradle repositoryThanks.
File -> Import > Gradle STS project -> Choose project root where multi-module folders reside -> click Build Model -> choose the modules I want to see in the IDE.
Hello , can i create multiple build. gradle for one project? Yes. You can have multiple build files in one project.
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
The sources of the subproject will be recognized by IntelliJ and you can use Navigate Class action for the classes in the subproject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With