This discussion is archived
1 Reply Latest reply: Apr 24, 2013 7:52 AM by 1005233 RSS

How to reffer external lib folder from a WAR

user10677329 Newbie
Currently Being Moderated
Hi All,

My WAR file has about 30 MB of jars inside WEB-INF/lib.
It has become a major pain to deploy the WAR every time, as it takes up too much time to FTP it to remote machines.

I am looking for a way to move most of my jars from WEB-INF/lib to an external directory on the server machine, and reference this directory from my WAR.
I know one way of doing this is to include each jar's location individually in MAINFEST.MF. But it's too cumbersome as I have many jars, and it is prone to errors as the syntax requires lot of specific spaces, new lines etc.

Is there a way to refer to an external directory from the WAR for required jars?
In case of a jar being present at both the WEB-INF/lib and the external directory, it would be good if WEB-INF/lib takes precedence.

Also, I want the jars in the external directory to be accessible only to my WAR file, not for other WARs deployed on the same server. So I need a way to specify this external directory location at the application (WAR) level, I do not want to put the jars into shared lib folders or server lib folder, which in any case is a bad practice.

Is there any way to achieve this?

Thanks flocks,

Edited by: user10677329 on Mar 22, 2013 4:39 AM

Edited by: user10677329 on Mar 22, 2013 4:40 AM


  • Correct Answers - 10 points
  • Helpful Answers - 5 points