title: Automatically share identical .jar files between .war files in tomcat
body: <p>Note: I'm pretty new to JVM deployment in general, so feel free to let me know that this is a completely wrong approach :)</p>
  
  <p>I have a bunch of self contained .war files, containing all their dependencies as .jar files. Some of my projects have shared dependencies, though. <strong>Is it possible to set up tomcat to automatically detect identical .jar files and reuse them across hosts?</strong> Or do I have to manually exclude these .jar dependencies from the .war, and put them in CATALINA_HOME/lib?</p>
  
  <p>I'd imagine a system that checks the .jar file info and checksum would be a good enough test.</p>
  
  <p>Note: The actual reason I'm needing this, is due to JNI. It would of course be nice to have other shared dependencies become shared, for lower memory usage etc, but it's an absolute requirements for my .wars that use the same JNI module, since I get class loader exceptions when Tomcat attempts to load the .jar file that loads the JNI module for the second time. This is apparently not supported by Tomcat.</p>