ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Need help including empty directories in WAR task (or Zip/JAR/TAR)
Date Tue, 09 Dec 2003 08:04:27 GMT
On Mon, 8 Dec 2003, Jeremy Nix <> wrote:

> I've been trying to figure out how to include an empty directory
> into a fileset based task for months now.

I've kept all (now four) of your messages on this subject in order to
look into it.  Sorry, somehow I never manage to get far enough down on
my TODO list.  I know that it works for me.


[bodewig@bodewig bodewig]$ cat /tmp/war.xml 
  <mkdir dir="test-setup/a/b/c"/>
  <mkdir dir="test-setup/d"/>
  <touch file="test-setup/a/b/c/e"/>
  <war destfile="test.war" webxml="${ant.file}">
    <fileset dir="test-setup"/>
[bodewig@bodewig bodewig]$ ant -f /tmp/war.xml 
Buildfile: /tmp/war.xml
    [mkdir] Created dir: /tmp/test-setup/a/b/c
    [mkdir] Created dir: /tmp/test-setup/d
    [touch] Creating /tmp/test-setup/a/b/c/e
      [war] Building war: /tmp/test.war

Total time: 2 seconds
[bodewig@bodewig bodewig]$ zip -Tv /tmp/test.war 
Archive:  /tmp/test.war
    testing: META-INF/                OK
    testing: META-INF/MANIFEST.MF     OK
    testing: a/                       OK
    testing: a/b/                     OK
    testing: a/b/c/                   OK
    testing: d/                       OK
    testing: a/b/c/e                  OK
    testing: WEB-INF/                 OK
    testing: WEB-INF/web.xml          OK
No errors detected in compressed data of /tmp/test.war.
test of /tmp/test.war OK

You see, d is included even though it is empty.  This is Ant 1.6,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message