WAR too big and deployment takes too long in Tomcat

Posted on October 30, 2011


Well, if your WAR file is too big (thanks to generous inclusion of jar files from all opensource projects you could find) … and deployments take too long … this is what you do.

  1. Remove the jar files from /WEB-INF/lib from your project, so they are no longer a part of the WAR file
  2. Copy the jar files to say, {TOMCAT_HOME}\common\lib\myprojlibs
  3. edit catalina.properties file in {TOMCAT_HOME}\conf … add to class.loader this path … ${TOMCAT_HOME}\common\lib\myprojlibs\*.jar
  4. Remember to add the $ and no ;s etc.
Regenerate the war (will be too small now … don’t worry) … deploy the new war file and restart Tomcat
That’s all there is to it. Don’t panic it your hour long deployment process now only too 2 minutes.
Posted in: Eclipse IDE