2
votes

I'm building an EAR with ant which needs to include the lib folder (including jars) from my EAR project. I've tried this but although a lib folder is created in the ear file no jars are included. Only the war files are copied into the ear.

<ear destfile="${ear.file}" appxml="META-INF/application.xml">
    <dirset dir=".">
        <include name="lib" />
    </dirset>

    <fileset dir="${temp.dir}">
        <include name="*.war" />
    </fileset>
</ear>
1
don't know why the dirset won't work, but you can achieve the same thing with a filesetoers
I should have been clearer - the folder is created but not the contentsblank
it is not really clear from the docs, but I suppose that dirset has to be taken literally. It only includes directories (and files are not directories).oers

1 Answers

3
votes

I used the zipfileset task instead, which does the trick:

<ear destfile="${ear.file}" appxml="META-INF/application.xml">
    <zipfileset dir="lib" prefix="lib"/>

    <fileset dir="${temp.dir}">
        <include name="*.war" />
    </fileset>
</ear>