I want to iterate over a list of jars (undefined number) and add them all to the jar file. To add them I plan to use something like this:
<jar id="files" jarfile="all.jar">
<zipfileset src="first.jar" includes="**/*.java **/*.class"/>
<zipfileset src="second.jar" includes="**/*.java **/*.class"/>
</jar>
but how do I iterate over them? I don't have ant-contrib
Thanks!
Just use
zipgroupfileset
with the Ant Zip taskThis will flatten all included jar libraries' content.
If you do not have access to
ant-contrib
For
task, you may end up to have to define your custom Task for doing what you need...If you have
ant1.6
and above, you can also trysubant
(see New Ant 1.6 Features for Big Projects):