Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manage Tomcat 6 libraries into subfolders under %TOMCAT_HOME%/lib?

I use Tomcat 6.0.20 and JDK 1.6.0.13.

How can I load libraries from sub-folders of %TOMCAT_HOME%/lib/ without taking the .jars out of sub-folders and putting them straight into %TOMCAT_HOME%/lib/?

The reason I want to do this, is because many apps are going to be sharing lots of libraries.

So, for the sakes of organization I want to store them into folders as such:

%TOMCAT_HOME%/lib/novell/*.jar
%TOMCAT_HOME%/lib/mail/*.jar
%TOMCAT_HOME%/lib/upload/*.jar

etc.

How would I go about this? And please provide an example. Do I use setclasspath.bat, catalina.properties or something completely different? Thanks in advance.

like image 745
Right E'Ous Avatar asked Nov 04 '09 17:11

Right E'Ous


1 Answers

Define those paths in shared.loader property of /conf/catalina.properties file.

E.g.

shared.loader = ${catalina.home}/lib/novell/*.jar, ${catalina.home}/lib/mail/*.jar, ${catalina.home}/lib/upload/*.jar

[Edit] optionally you can also use the common.loader property for this. See what has your preference.

like image 66
BalusC Avatar answered Sep 30 '22 19:09

BalusC