使用ANT把J2EE工程发布到Tomcat里
本人在clipse中使用的
<?xml version="1.0" encoding="UTF-8"?>
<project name="s2" default="打包" basedir=".">
<property file="build.properties"/>
<property environment="env"/>
<target name="clean" description="Delete this project!!">
<echo message="${env.JAVA_HOME}"/>
<delete dir="${build.home}"/>
<delete dir="${dist.home}"/>
</target>
<target name="init" depends="clean" description="This is mkdir target">
<mkdir dir="${build.home}"/>
</target>
<target name="compile" depends="init" description="This is compile the JAVA SOURCE!!">
<mkdir dir="${build.home}/WEB-INF/classes"/>
<javac srcdir="${source.home}"
destdir="${build.home}/WEB-INF/classes">
<classpath>
<path>
<fileset dir="${lib.home}"/>
</path>
</classpath>
</javac>
</target>
<target name="build" depends="compile" description="Copy all no JAVA class to build directory!!!">
<copy todir="${build.home}">
<fileset dir="${app.home}" excludes="**/*.class" />
</copy>
<copy todir="${build.home}/WEB-INF/classes">
<fileset dir="${source.home}" excludes="**/*.java"/>
</copy>
</target>
<target name="打包" depends="build" description="打成war包">
<mkdir dir="${dist.home}"/>
<jar destfile="${dist.home}/${pro.home}.war"
basedir="${build.home}"/>
</target>
</project>