I am developing with Eclipse as my IDE. I have a project (my model) that the web-app depends on to compile and run. This model project also has jars in it that are needed by both it, and the web-app.
I have selected the needed project as a dependency in Eclipse’s deployment assembly option for the web-app. I have also selected which jars to export on the model project’s build configuration screen. All of my source code seems to be accessible at web-app runtime, but the library jars in the project are not (I get class not found exceptions)
Can tomcat not reference jars in jars as I think I am trying to do? Do I have to actually include all of the jars I want by going into deployment assembly and selecting “Archives from Workspace” in addition to the project I already have selected? (and thus making the “export” options in the model project useless?)
I’d prefer not to copy them over in the WEB-INF/lib directory as then I would need to manage two versions of this single library in our version control.
My understanding is the Tomcat has to have the files within WEB-INF/lib to access these at runtime. What you could do is put the jars within this directory but then reference these from your model project so you don’t have to copy them twice.
The answer below may also be of help How to work with referenced projects in eclipse