tmn
tmn

Reputation: 11559

Gradle multi-project builds and IDEA, are modules not automated?

I was doing some experimenting with Gradle and created a multi-project build, with multiproject_test dependent on two projects ChildA and ChildB. I put this simple test project on GitHub. https://github.com/thomasnield/gradle_multiproject_test

Everything seems to be working great on the command line and Eclipse. Everything was compiling and the dependencies were being recognized and used. But when I imported the project into IDEA it did not create the dependencies. It seems like I had to manually create the modules although it did import the source code from the child projects.

My question is do I have to specify these module declarations separately in the build.gradle script for IDEA? Why would it not even compile the dependencies?

UPDATE Solution proposed below worked great. IDEA handled the build.gradlescript much more gracefully than the idea plugin.

enter image description here

Upvotes: 0

Views: 1260

Answers (1)

Amnon Shochot
Amnon Shochot

Reputation: 9386

Loading a Gradle project to build an IDEA project by using the idea plugin does not always work well. The recommended way to load a Gradle project in IDEA is to import the build.gradle file from the root project.

More detailed instructions can be found in IDEA documentation here.

Upvotes: 1

Related Questions