External System Plugin Module with multiple source roots
Still working on a large external system plugin, and I've run into a problem where IDEA seems to not find all classes properly. I _think_ it's a case where more than one source roots contain the same java packages, with different classes. IDEA appears to ignore any packages that already exist when looking in other source roots.
Basically, a module in my system can contain multiple source roots, which can then contain the same or similar package layouts.
Additionally, it may have to do with that some modules may overlap their contentroots. Eg: ModuleA's root is /foo and one of it's source roots is /foo/blah/baz, then theres ModuleB with a root of /foo/blah. I have not verrified this is related, but I can imagine it might confuse the IDE (it already does confuse the project tree's icons, it can't tell that /foo/blah/baz is a source root at all, even though its listed in the project structure properly)
请先登录再写评论。
Indeed, IntelliJ Idea does not support overlapping source folders structure.

While content roots can be nested, one can not mark a folder that belongs to nested module as a source for outer module. Described settings will produce following error message:
Other than this, IDEA Platform does not have any limitations about having same packages in different modules or content roots.
Thank you. That explains it. I was afraid that was the case. Would you have any suggestions on how to handle these cases?
So far my best idea is to merge some of these modules and attempt to patch up any missing dependencies caused by that.
Just want to verify something though.. Presume I have the following structure:
foo/ (foo module contentroot)
foo/bar/ (bar module contentroot)
foo/bar/src (bar module SOURCE path)
foo/bar/frob/src (foo module SOURCE path)
where foo is the outer module content root. foo/bar is inner module content root with src as a SOURCE path via barModule.contentRoot.storePath. and foo/bar/frob/src is a SOURCE path for foo via fooModule.contentRoot.storePath.
I presume based on what you said, that won't work. Is that right? What if a separate ContentRoot object is added to fooModule just for foo/bar/frob instead of adding foo/bar/frob/src directly to the main fooModule ContentRoot?
eg:
foo/ (foo module contentroot)
foo/bar/ (bar module contentroot)
foo/bar/src (bar module SOURCE path)
foo/bar/frob (foo module contentroot #2)
foo/bar/frob/src (foo module contentroot #2 SOURCE path)
This will not work either, unfortunately. IDEA will not allow a two nested content roots for same module.
So only current option is adding the third module, with single content root at foo/bar/frob/src and a source folder `.`
Thank you :)
I've had issues in the past with trying to assign a source folder as the same path as the ContentRoot object. Can't recall the exact details but it usually claimed the path was outside the content root. hmm... I just noticed you said a folder of ".". I see. I don't believe I actually tried that.
I've gotten things to work since i can currently fudge the module structure somewhat. I've merged modules that conflict like that automatically on import. So far I haven't noticed any problems from doing that, but it may break in the future.
Something along the lines of your suggestion may be the better solution long term. For now though I think merging modules will do as I've run out of time to work on this much for the next few months.