I am building a war file using ANT and I want to include the src directory into the war file. When I use the fileset element, only the content of that folder is included. I want the src directory to be included into the WEB-INF folder. I don't want to copy the sources to the WEB-INF folder on disk. Ant properly includes the jars from my lib directory into WEB-INF/lib
without copying them in my project.
So I will have something like this:
/WEB-INF
/WEB-INF/src
/WEB-INF/classes
/WEB-INF/lib
/META-INF
The target looks like this:
<target name="war" depends="init">
<war destfile="dist/web.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir="WebContent"/>
<lib dir="WebContent/WEB-INF/lib"/>
<lib dir="lib"/>
<classes dir="build/classes"/>
<classes dir="config"/>
</war>
</target>