x.509
x.509

Reputation: 2235

ANT Warning: please use webxml attribute to war task

I am getting this warning even though i am using webxml in my ANT task

here is my ANT file

<project name="start" basedir="./">

    <property name="web.dir" value="war"/>
    <property name="name" value="start"/>

    <target name="package" description="Packaging Start WAR">
        <war destfile="${name}.war" webxml="${web.dir}/WEB-INF/web.xml">
        <fileset dir="${web.dir}">
            <include name="**/*.*"/>
        </fileset>
        </war>
    </target>

</project>

Am i missing something. Even though when war is being created, it copies appropriate web.xml in it. but why i am getting this as WARNING

Upvotes: 1

Views: 1396

Answers (1)

Raghuram
Raghuram

Reputation: 52635

This discussion is related to your problem.

This should fix the warning (I haven't tried it though). Essentially exclude web.xml from the fileset, since this is being specified in webxml attribute.

<property name="web.dir" value="war"/>
<property name="name" value="start"/>

<target name="package" description="Packaging Start WAR">
    <war destfile="${name}.war" webxml="${web.dir}/WEB-INF/web.xml">
    <fileset dir="${web.dir}">
        <include name="**/*.*"/>
        <exclude name="**/web.xml"/>
    </fileset>
    </war>
</target>

Upvotes: 4

Related Questions