I am attempting to deploy my webapp using maven to an embedded tomcat server. I am running into issues.
My project is a multi-module maven project. I have a number of “jar” modules, and then a web-app that uses these jars. When I deploy to a locally installed tomcat server, it works properly. When I have already built and installed the other jars, then separately build and deploy the webapp to the embedded server, it also works properly. When I attempt to build the entire project, jars and the webapp, the embedded tomcat server deployment fails. Whatever I try, it always comes down to one of my jars seems to not be deployed. Tomcat complains that it cannot find some class that is located within this one jar. When I remove that class, then Spring complains that it cannot find a applicationContext.xml file which is located within this same jar. It comes down to one of my jars is not being found.
I have been trying to investigate why this jar is not being found. I ran maven with the -X to get more data. I did find this:
[DEBUG] add dependency to webapploader com.myproject:security-lib:1.0-SNAPSHOT:compile
[DEBUG] skip adding artifact security-lib as it’s in reactors
But, I also noticed that all of my own jars get this same message. They seem tobe found by tomcat.
Does anyone have any suggestions why my embedded tomcat server is not getting this jar file? And why the embedded tomcat server works when I deploy it by itself, but does not work when I deploy it while building the entire project? Any tips on debugging this would be appreciated.
I found the issue. I was using the “run” goal. I intended to use the “run-war” execution goal for the tomcat-maven-plugin.