<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Test" basedir="." default="deploy">
<property name="warfile" value="Test" />
<target name="unpack">
<unwar src="${warfile}.war" dest="${warfile}" />
</target>
<target name="create">
<war destfile="${warfile}.war" webxml="../WebContent/WEB-INF/web.xml" update="true">
<classes dir="classes" />
<fileset dir="../WebContent">
<exclude name="WEB-INF/web.xml" />
</fileset>
</war>
</target>
<target name="copy">
<copy todir="D:\bea\user_projects\domains\Test\applications" overwrite="true">
<fileset dir=".">
<include name="*.war" />
</fileset>
</copy>
</target>
<target name="deploy">
<antcall target="create" />
<antcall target="copy" />
</target>
</project>
写好后直接运行该Ant文件。就会在D:\bea\user_projects\domains\Test\applications生成一个名叫Test.war的文件