Multimodule project
I have next problem:
i have 3 modules: app, main, physics;
app depends on main and physics.
physics depend on main
So i add main into app and physics.
As a result: after compiling i've got error about some classes, that was alredy added.
How i should add this modules correctly ?
Please sign in to leave a comment.
Hello Dmitry,
What do you mean by "add main into app and physics"? You need to add module
dependencies between modules.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
it mean that i add main as dependency in app and physics. That is why i can't compile project.
How should i add module dependencies between modules ?
Hello Dmitry,
How is your project structured? Normally in a multimodule project each class
is compiled only once.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
one more time:
i have app module which is depended on main module;
Also app module depende on physics module;
In this time physics module depended on app module;
So i do next:
app -> proj settings -> dependencies -> add main module
app -> proj settings -> dependencies -> add physics module
physics -> proj settings -> dependencies -> add main module
In this case i add main module twice. But i can't do otherwise, because i will get some error in physics module which will cause by unknown classes from main.
Hello Dmitry,
Please describe your project structure on disk (which files are located where).
Also please provide the exact error message that you get.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
project structure:
/--folder
|
|----- / folder
| |
| |----/ main module
| |
| |----/ physics module
|
|-----/ app module
Error:
classes was alredy added(something like that)
Hi Dmitry,
Could you provide minimal but comlpete standalone project that illustrates the problem?
The thing is that the structure you described is perfectly valid and doesn't show any error at my local environment.
Also provide information about your OS, target IJ and JDK versions.
Denis
i just create test project with the same structure and it works!
then i go to my main project and it work too)
so strange. i will test this again and if any - i will say you