I have an IDEA 9.0.1 project that has several interdependent modules and I am having problems setting up the dependencies so that IDEA does not get confused.
The modules are a 'Client' module and a 'Server' module. The Server module is a JEE application that runs as an EAR in JBoss. It has several JARs that are used by both the Client and the Server. The Client is a standalone application that connects to the server.
In the past I used two separate projects - one for the Client and one for the Server. But this caused serious performance problems when I edited a file in one of the projects that was used in the other project - 100% CPU thrashing for long periods. To avoid this I had to resort to closing the client project whenever I needed to make a change in the Server project. To avoid this I am trying to configure both modules in a single proejct.
There are ANT build files to compile and package the JAR and EAR files - they are not compiled or built in IDEA itself.
The Client must use the JAR files from the Server module to operate properly - it cannot simply use the classes directly. To run and debug the Client I need these JARs to be part of the Client classpath, which means they must be declared as dependencies of the Client module. In these module dependencies, I specify the path to the source files for the classes.
I must also specify the path to the Server source files in order for these files to be 'in the project' so I can use refactoring, etc. But IDEA gets totally confused because the same class is in the Server source path as well as in the JAR that is used by the Client module. IDEA is unable to locate classes in the same package as other classes and they show up in red.
How should this project be configured so that IDEA does not get confused between instances of classes in dependent jars and those that are implied by by source files? I do not want to have to build everything twice: my ANT build files are the primary way the code is compiled and packaged so I don't want to be forced to also build everything in IDEA as well.
Any hints or suggestions will be greatly appreciated.