Update: I am using Ant 1.8.1 on Windows XP.
I am trying to write an Ant master build file for multiple projects. I can successfully create a jar for each project, and I want to package all of these jars into a single tar.gz file. Each jar file is located within the bin subdirectory of its respective project, but this path could be changed in the future. I've tried something like this:
<tar destfile="foo.tar.gz" compression="gzip" >
<tarfileset dir=".">
<include name="**/*.jar" />
</tarfileset>
</tar>
...which kind of works. The only problem is that it maintains the directory structure within the jar. I want a flat file. So instead of:
foo.tar.gz
project1
bin
project1.jar
project2
bin
project2.jar
etc...
I need:
foo.tar.gz
project1.jar
project2.jar
I attempted to use Ant's copy task to copy these jar files to a temporary directory and then tar them from there. However, the copy operation replicates paths within the target directory. So, same problem.