ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Lynch" <b...@jivesoftware.com>
Subject Add contents of multiple JARs to a Jar?
Date Thu, 28 Feb 2002 18:03:38 GMT
All,

I'm looking to merge the contents of several jars into one. I've tried:

<jar
   jarfile="${jar.dest.dir}/foo.jar"
   manifest="${resources.dir}/share/manifest.mf"
>
   <fileset dir="${build.dest.dir}"
      includes="com/foo/**/*.class"
   />
   <zipfileset dir="${build.lib.merge.dir}">
      <patternset includes="*.jar" />
   </zipfileset>
</jar>

"build.lib.merge.dir" is where I have about a dozen jar files that I want
merged into foo.jar. Right now, I get:

(contents of foo.jar:)
foo.jar
  \-- bar.jar
  \-- bar2.jar
  \-- bar3.jar
  \-- .class files from my compile process

What'd I'd like is:
foo.jar
  \-- .class files from all jars and my compile process

How can I change my jar target to accomplish this? Do I need to write a
custom task for this sort of thing? BTW, my work around right now is:

<jar
   jarfile="${jar.dest.dir}/foo.jar"
   manifest="${resources.dir}/share/manifest.mf"
>
   <fileset dir="${build.dest.dir}"
      includes="com/foo/**/*.class"
   />
  <zipfileset src="${build.lib.merge.dir}/bar.jar" />
  <zipfileset src="${build.lib.merge.dir}/bar2.jar" />
  <zipfileset src="${build.lib.merge.dir}/bar3.jar" />
  ...
  <zipfileset src="${build.lib.merge.dir}/bar-n.jar" />
</jar>

Thanks in advance,
--Bill


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message