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 13:51:42 GMT
On Tue, 9 Dec 2003, Jeremy Nix <> wrote:

> Notice that you touched a file (which creates a file) in the empty
> directory.

I did not.  I touched a file in one dir, but there also is an empty
directory (d) and the empty as well as the dir including a file are

> When you remove that touch command, all directories are empty
> (without files), and the war command contains nothing but the
> web.xml that you specified.

Let's see

[bodewig@bodewig gump]$ rm -r /tmp/test.war /tmp/test-setup/
[bodewig@bodewig gump]$ 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 gump]$ 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
      [war] Building war: /tmp/test.war

Total time: 2 seconds
[bodewig@bodewig gump]$ 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: WEB-INF/                 OK
    testing: WEB-INF/web.xml          OK
No errors detected in compressed data of /tmp/tes
test of /tmp/test.war OK

it works.  It may be that it doesn't work with 1.5.x, but it works for
me using 1.6.


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

View raw message