ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject <war> and web.xml
Date Sat, 28 Oct 2006 20:32:46 GMT

I've been updating the war file task with better support for optional 
web.xml files. Its been a bit tricky, but I've got a good set of unit 
tests. I so love antunit, BTW :)

Here's the current setting

1 -Unless you say needxmlfile="false", the web.xml file is mandatory. 
This is compatible with what we have today

1.5 you can omit the webxml attribute if update=true; again, what we 
have today.

2 -We dont warn if the xml file is duplicated in a fileset, *provided* 
the path of that reference matches that of the webxml attribute. I.e you 
can duplicate it in any fileset without complaints.

These two keep everything compatible with what we had before. You forget 
a web.xml file, the build halts. Which is what you usually want.

3. if you set needxmlfile=false, then a web.xml file becomes *optional*. 
It is no longer an error to omit the file.

4. You can then pull in a web.xml file via the webxml attribute, or via 
a nested fileset. In either case we say
"Although needxmlfile is false, a web.xml file was included " ... and 
point to the file that was added.

5. once you set needxmlfile=false, and omit the web.xml attribute, you 
can pull in a WEB-INF/web.xml from a fileset. What if there is >1 match 
in the fileset? The first one added wins; there is no extra warning message.

6. When updating an existing war file, if update=false and 
needxmlfile=false, then things get complex. The problem here is that 
there isnt a webxml file, so stuff from filesets get pulled in. but 
dependency logic in the fileset checking engages first.

(4), (5), and (6) bother me. I think its possible to create confusion as 
to which web.xml file gets pulled in. What do people think?

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

View raw message