Recently moved to Intellij from eclipse it seems to be tough to have this setup in intellij 14.
Note: I cannot use maven
Steps I have followed created a "test project" and "test project 2"
-> opened test project project structure in cmd+; (shortcut in mac)
-> in project settings modules clicked on "+" and selected "import module" option
-> selected project 2
-> I got this error message stating that
cannot save settings, must not contain source root /test/src. The root belongs to module test`
This link is more confusing , could not understand much https://www.jetbrains.com/idea/help/configuring-content-roots.html
Can any one explain how to solve this?
Eclipse's concepts of "workspace" and "project" are matched by IntelliJ IDEA's "project" and "module" respectively. So to achieve similar setup as in your screenshot, create an ampty project, and import the modules "core", "model". .. to it.
Then open the "File > Project Structure" and check and adjust each module's "sources" and "test sources' folder. Make sure no source or test source overlap (this is the reason you got the "cannot save settings" error).
See for example the screenshot below. The project is called "test" and is in "C:\Projects\test". The module "springapp" is in "C:\Projects\test\springapp", its sources are marked "C:\Projects\test\springapp\src", its test sources are "C:\Projects\test\springapp\test". The same for the other modules.
Especially note that no one of the modules marks the root folder "C:\Projects\test\" as a "sources" or "test sources" (As I wrote above this is the reason for the error you got).
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