0

I have a Spring Boot MVC Application which I intend to deploy as WAR file in Tomcat8. I noticed, the WAR contains all dependencies on WEB-INF/lib and WEB-INF/lib-provided folders. I verified that moving all contents of these dependencies folders to <TOMCATDIR>/lib removes the necessity of having those jars in the WEB-INF/lib* folders, so I moved them all. The application is working as expected.

Suppose, I have many WARs that need to be deployed on the same server and most of them have similar dependencies. Having all the JARs in individual applications' library folders seems like a waste of space to me.

My question is, is it a good idea to move all the JARs from individual applications' library to the Tomcat's library? Will it cause me any problems in future? If it will, what sorts of problem am I likely to come across?

PPrasai
  • 1,186
  • 13
  • 36
  • Related: http://stackoverflow.com/questions/31138560/tomcat-8-classloading-difference-between-jar-in-web-inf-lib-and-tomcat-lib?rq=1 – Thilo May 06 '16 at 05:35
  • thank you. it is related, but does not fully answer my question. – PPrasai May 06 '16 at 05:58
  • 4
    As soon as two application have the same dependency in different versions, you will run into problems. Also, everytime you deploy your application, you have to remember to also update the JARs in the tomcat/lib folder, which will increase deployment complexity. I'm a big fan of self-contained deployment units, so i wouldn't use that folder at all. Disk space is not expensive any more. – dunni May 06 '16 at 06:03

0 Answers0