><mkdir dir="${build.home}/META-INF"/>
><copy file="${basedir}/context.xml"
>todir="${build.home}/META-INF"/>
>
>and now it's ok. However, since Ant creates META-INF
>directory automatically (and even puts MANIFEST.MF
>into it) I wonder if what I did is unnecessary and
>whether there's some property or attribute(which I
>failed to find in Ant documentation) that results in
>automatic context.xml inclusion in WAR file.
As far as I know, there is not a parameter on the WAR ant task that takes
the context.xml, so your assumption of copying the context.xml into that dir
is fine.
But, there is a nested <metainf> tag for the WAR task that I think is more
suited to your task.
Here's an example from my build.xml:
<property name="metainf.dir" value="${basedir}/META-INF"/>
<war destfile="${build.dir}/${name}.war"
webxml="${jsp.dir}/WEB-INF/web.xml">
<metainf dir="${metainf.dir}"/>
...
</war>
The docs from http://jakarta.apache.org/ant/manual/CoreTasks/war.html state:
metainf
The nested metainf element specifies a FileSet. All files included in this
fileset will end up in the META-INF directory of the war file. If this
fileset includes a file named MANIFEST.MF, the file is ignored and you will
get a warning.