Classpath issue with Module
I am trying to evaluate Intellij ultimate as a possible replacement for eclipse. I have a legacy project which i am trying to get running. I have project which is a war and also there are many modules/projects which are dependencies. All of which i have as part of the same project.
The eclipse structure of this is 1 workspace many projects. One primary application and other library type jars. This is not a multi-module maven project.
When trying to run the application in intellij with smart tomcat I run into what I believe is a classpath issue. Our application performs a preload. Some of the classes which are to be loaded exist in a module which is not the primary project. The classloader picks up the primary project and then all the maven dependencies. The other modules which are in the project are not there. Tomcat starts and runs the application but since the related modules were not preloaded things are missing.
What I get from the classloader is
- application/target/classes
- .m2/repository/something.jar
- etc
What I need is
- application/target/classes
- module1/target/classes
- module2/target/classes
- .m2/repository/something.jar
- etc
I have tried a number of different suggestions/options to no avail. Eclipse produces the appropriate classpath. Maybe I am wrong in expecting that modules should be represented in the same way eclipse does? The modules are there otherwise I would expect to have no class def found issues. Where ever or however they exist is not getting picked up.
Please sign in to leave a comment.
AFAIU you are deploying a war atifact that is produced by the IDE to a Tomcat server?
IDE assembles the artifact from the module sources, module resources and module dependencies. Sources are take from the war module sources and are placed into WEB-INF/classes, resources are takes form module's resources and are placed into the WEB-INF directory. The dependencies of the war module are taken from the module's dependencies - you can see them in the module's Dependencies tab placed into the WEB-INF/lib directory. Eah dependency has it's scope. If the scope is specified as provided - the dependency is not placed into the war artifact.