Summary
Is that possible for webapps deployed on linux + tomcat5.5 to use/see all /usr/share/java/
jars automatically?
Details
I'm packaging my java webapp for Ubuntu (yet the question is related to any linux-based distro) and going to make it depend on tomcat.
I'm going to put context descriptor (an xml file) to /usr/share/tomcat5.5/conf/Catalina/localhost/
to make my app deployed.
Having my web dir here: /usr/share/<appname>/web
, how can I enable my app to use java jar libs installed in the system (/usr/share/java
)?
I can't just symlink /usr/share/java -> <webdir>/WEB-INF/lib
, since I have my custom jars need to be placed in lib
dir.
Bad Solution
The solution I've found so far is to symlink each required jar to <webdir>/WEB-INF/lib/
.
This is not so good, because I have to symlink a lot of jars and even worse to symlink all jars my direct dependency lib (jar) requires (and so on). In case my direct dependency lib changes its list of required jars I'll have to maintain that symlinks.