I have a Maven artifact which is named as XYZ and when I try to add it as a web module to my Tomcat server in eclipse, it gets added and I could immediately see a Host xml entry being added to my Tomcat server.xml as below:
But in my pom.xml, I have the following defined:
I would assume that the docBase should have been MyWebApp instead of web as it is above in the server.xml. I even tried to change it manually in the server.xml, but nothing seems to work. The context that I would like to start it not simply working. Any suggestions on how to get this fixed?
I have got one step better. I right clicked on the web project and opened properties and under Deployment Assembly, modified the source. I get to see the following error:
I got suspicious that the lib folder might be missing and my guess was correct. I checked under the Tomcat directory and I do not see the lib folder under WEB-INF. Since this is a Maven project, the lib folder would simply be empty and will be populated as a result of Maven build. But how to handle this case here? How to add the dependent libraries so that they end up in the lib folder?
Finally got rid of this problem as well. Did the following:
Right click on the web project > properties > Deployment Assembly > Add > Java Build Path Entries and add all the jars that need to be added for the web project. Then clean and publish to the tomcat server and it started to recognize the project and my context starts up properly.