We have some legacy java applications with many class folders and redundant jars on the classpath. One vendor even ships updates via an "overrides" jar that we must prepend to the classpath. Although clean-up ought to be a medium-term goal, I'm wondering if there are any tools out there that will collapse all these directories/jars into one structure that represents the versions of files that would actually be classloaded in a running system. I guess I could write a script that copies directories on top of each other in the proper order and cracks jars, etc. However, I'm hoping that this has been done already.
OneJar (http://one-jar.sourceforge.net/) can gather up a classpath into an enclosing jar, but it relies on a special classloader implementation to access jars within jars.
The commenter below (who should resubmit this as an answer!) had a good suggestion. I haven't had a chance to test it out yet.