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.