I have a project where I want to share source code between two java modules.
They are organized like this: I have a main Java module located in "projectroot/" and another module located in "projectroot/utility/".
In the utility module I use some of the classes from the main module, so I created a project library with attached sources in "projectroot/src". This didn't give me access to the main modules in the utility module (still 'cannot resolve...' errors).
By coincidence, I found out I had to add "projectroot/classes" to the project library. OK this meant that my utiliy module classes could 'see' the main module classes. BUT - of course only the classes that are compiled in the classes dir. This means that it didn't register if I change something in the main module classes.
Other strange things also happened - I suddenly had to use the same project library in the main module in order to see the classes, even though they reside in the sources directory under the main module's content root. Strange.
I gave up ... my solution was to remove the utility module and just have one, big module including it.
Is it just me, or could this be done somehow. It seems reasonable that you should be able to use sources from another module in idea, doesn't it?