Wednesday, April 20, 2011

Create a single jbossall-client.jar bundle in JBoss 5.0.x?

Since JBoss 5.0.0, jbossall-client.jar only contains a manifest that points to all the jars in the client directory. Is there any way to create a jbossall-client.jar that contains all of these classes instead of having to put the 70 or so individual jars on the classpath?

From stackoverflow
  • Combining all client jars to a single jar may not be recommended. However if you are keen to see a single jar with all classes loaded in it one approach would be to write an ant script which can unjar the required jars to a temp dir and then make a single jar of the classes in the temp dir.

       <target name="unjar.jar">
            <unjar dest="${temp.dir}">
                        <include name="**/*.class" />
                  <fileset dir="${lib.dir}">
                        <include name="**/*.jar" />
      <target name="combine.jar" depends="unjar.jar">
            <jar jarfile="${base.dir}/${jar.filename}"
                  basedir="${temp.dir}" includes="**/*.class" update="true"
            <delete dir="${temp.dir}" quiet="true" />
    Andrew : Yes, I know that they decided to use the manifest method to allow users to swap out individual jars if necessary. However, they used to create a single jar client and other app servers such as Weblogic have a JarBuilder tool to accomplish this. I think your method may do the trick, thanks.


Post a Comment