tomcat 打包位置不对,打在了工程目录下,而不是tomcat安装目录webapps里面
撼地神牛 2012-05-25 03:17:09 ant.xml
<?xml version="1.0"?>
<!-- Copyright : adobocode.com , 2010 -->
<project name="SampleSpringMVC" basedir="." default="build">
<property file="ant.properties"/>
<property name="src.dir" value="src"/>
<property name="war.dir" value="WebRoot"/>
<property name="build.dir" value="${war.dir}/WEB-INF/classes"/>
<property name="deploy.path" value="${tomcat.home}/webapps"/>
<property name="name" value="SampleSpringMVC"/>
<path id="master-classpath">
<fileset dir="${war.dir}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/lib">
<include name="servlet*.jar"/>
</fileset>
<pathelement path="${build.dir}"/>
</path>
<target name="build" description="Compile main source tree java files">
<echo>Building...</echo>
<mkdir dir="${build.dir}"/>
<javac destdir="${build.dir}" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="master-classpath"/>
</javac>
</target>
<target name="war-archiving">
<echo>Archiving...</echo>
<war destfile="${name}.war" webxml="${war.dir}/WEB-INF/web.xml">
<fileset dir="${war.dir}">
<include name="**/*.*"/>
</fileset>
</war>
</target>
<target name="deploy" depends="build">
<echo>Deploying...</echo>
<copy todir="${deploy.path}">
<fileset dir=".">
<include name="*.war"/>
</fileset>
</copy>
</target>
</project>
ant.properties
tomcat.home=D:\Program Files (x86)\apache-tomcat-6.0.35-windows-x64\apache-tomcat-6.0.35
tomcat.lib=${tomcat.home}/lib