Reputation: 71
Hi In my project I have many many jars. Every time I change code and need to upload it to the server takes very long time, because I m adding the jars to the war to be deploy on tomcat. I m trying to put all the jars in the server, in some folder and to upload the rest of the project only, to speed the cycle. What will be the best way of doing that ?
I m using tomcat 8.5 also for production deployment without any build tool. I would like to set an ABSOLUTE path in the classpath but when doing that in my local machine it won't work after deployment to the unix server.
I never saw where or if I can set an absolute path for the jars (NOT OF THE LOCAL MACHINE)
Thanks in advance
Upvotes: 7
Views: 1545
Reputation: 34900
You can read about this in Tomcat docs: Class Loader HOW-TO.
The most simple case and way - put these commonly used jars into $CATALINA_BASE/lib
dir - they will be loaded by Tomcat class loader.
But, it doesn't seems to be very nice practice, as mentioned tutorials claims:
Normally, application classes should NOT be placed here.
Personally me, in practice purposes, I would ignore this hint and still place jars inside this folder. But if you want to be accurate, you could create separate path on server (or even inside CATALINA_BASE folder) and place jars there. After that you have to specify this path in $CATALINA_BASE/conf/catalina.properties
file in common.loader
property:
common.loader="${catalina.base}/lib","${catalina.base}/lib/*.jar","${catalina.home}/lib","${catalina.home}/lib/*.jar"
Upvotes: 1