Clean way to combine multiple jars? Preferably using ant
Posted
by Jacob
on Stack Overflow
See other posts from Stack Overflow
or by Jacob
Published on 2009-02-05T11:01:13Z
Indexed on
2010/03/18
4:01 UTC
Read the original article
Hit count: 239
I have runtime dependencies on some external jars that I would like to "rejar" into a single jar. These external dependencies are stored in a external_jars directory, and I'd like to be able to not have to list each one out (e.g., to not need to change my build scripts if my dependencies change). Any thoughts?
Google gave me a good answer on how to do this if you don't mind listing out each jar you want as a dependency:
http://markmail.org/message/zijbwm46maxzzoo5
Roughly, I want something along the lines of the following, which would combine all jars in lib into out.jar (with some sane overwrite rules).
jar -combine -out out.jar -in lib/*.jar
© Stack Overflow or respective owner