IDEA9: Not all modules displayed in Project view

I have an IDEA7 project which I opened in IDEA 9.0 Community Edition. It has 20 modules defined in the project structure but only 7 of those modules are displayed in the Project view of the Project toolwindow. There are no error messages in idea.log. Files and classes in the undisplayed modules are accessible through Goto Class (Ctrl-N).

How do I get all the modules displayed in the Project view?

3 comments
Comment actions Permalink

In IDEA 9 Project Structure shows file system with module content roots marked with bold. So you probably have nested module content roots and you will see them one or more levels deeper in the folders tree. You may check that your project still contains all modules at Project Structure dialog (Ctrl+Alt+Shift+S)

0
Comment actions Permalink

I do have a module (called src) which contains the entire project and then additional modules which contain specific subpackages of the java source root (src/java). Some of the subpackage modules appear in the Project view but some do not.

I believe I have determine what is happening. Some of the modules have content roots which are outside of the src module's content roots, e.g. java code generated by the build script. Only these modules are displayed in the Project view. Modules which only have content roots which are subdirs of the content roots in the src module are not visible. I tested this by removing the content root for generated code from one of the visible modules and that module then disappeared from the Project view.

To fix this, I've marked some root paths in the src module as excluded for the content roots in the other subpackage modules. This made all the modules appear in the Project view except for a few where the path excluded was exactly the same as the content root path in the other module, e.g. my javatest module.

The javatest module contains src/java-test as a content root and it's marked as test sources. The src module contains src as a content root and src/java-test is marked as excluded. If I change the javatest module to instead have a content root pointing to src/java-test/my/package/name marked as test sources, then I can see the javatest module in the Project view, but classes from that module do not have their package prefix detected like they do if the content root is marked as "sources". So all the package lines are marked as errors in the test classes.

How do I solve this? I need the src module with the src directory as a content root because my Ant build scripts are in the src directory, otherwise I would have only selected the other subdirectories of src to include in the module, thus avoiding this problem. I can't move the build scripts because they're expected to be in that location by nightly builds which I do not have the authority to modify.



What I would really like is an option to always display all the modules in the Project view, regardless of whether some of them are contained within other modules.
0
Comment actions Permalink

So it looks like I don't need to have the Ant build scripts visible in a content root to select them in the Ant build window. And changes to the Ant build scripts do still make it appear in my Changes window. So I've changed the src module to use content roots for each subdirectory of src except java and java-tests. This now shows all modules in the Projects view, although the order is very odd. It appears to have sorted modules which contain multiple content roots at the top and then all modules which have a single content root after that. I would have expected them to be sorted all together in alphabetical order by module name.

0

Please sign in to leave a comment.