Ant 编译部署工程
<?xml version="1.0" encoding="UTF-8"?> <project name="icap" basedir="." default="all"> <property name="tomcat.home" value="D:/tomcat" /> <property name="servlet-api.jar" value="${tomcat.home}/lib/servlet-api.jar" /> <property name="jsp-api.jar" value="${tomcat.home}/lib/servlet-api.jar" /> <property name="distpath.project" value="${tomcat.home}/webapps" /> <property name="project.distname" value="icap" /> <property name="dir.src" value="src" /> <property name="dir.webinf" value="WebRoot/WEB-INF" /> <property name="dir.classes" value="${dir.webinf}/classes" /> <path id="compile.classpath"> <pathelement path="${dir.classes}" /> <pathelement path="${classpath}" /> <pathelement path="${servlet-api.jar}" /> <pathelement path="${jsp-api.jar}" /> <fileset dir="${dir.webinf}/lib"> <include name="*.jar" /> </fileset> </path> <target name="prepare"> <tstamp /> </target> <target name="resources"> <copy todir="${distpath.project}/${project.distname}" includeEmptyDirs="no"> <fileset dir="WebRoot/"> <patternset> <include name="**/*.*" /> </patternset> </fileset> </copy> <native2ascii src="WebRoot" dest="${distpath.project}/${project.distname}" includes="**/*.properties" encoding="gb2312" /> </target> <target name="compile" depends="prepare,resources"> <mkdir dir="${distpath.project}/${project.distname}/WEB-INF/classes/"/> <javac srcdir="${dir.src}" destdir="${distpath.project}/${project.distname}/WEB-INF/classes/" encoding="utf-8"> <classpath refid="compile.classpath" /> </javac> </target> <target name="clean" description="Prepare for clean build"> <delete dir="${distpath.project}/${project.distname}" /> <delete dir="${distpath.project}/${project.distname}.war" /> <mkdir dir="${dir.classes}" /> </target> <target name="project" depends="clean,prepare,compile" /> <target name="dist" description="Create binary distribution"> <war basedir="WebRoot" warfile="${distpath.project}/${project.distname}.war" webxml="${dir.webinf}/web.xml"> <exclude name="${distpath.project}/${project.distname}.war" /> </war> </target> <target name="all" depends="project" /> </project>
相关推荐
BitsPlayer 2020-05-29
roygbip 2020-02-16
BitsPlayer 2020-02-13
lrcoop 2020-02-03
chichichi0 2020-01-06
BitsPlayer 2019-12-19
BitsPlayer 2019-12-14
xueliangEmail 2013-07-22
cailianren 2010-04-15
wugang0 2019-11-09
lustdevil 2011-08-28
evilvoid 2008-04-17
leonranri 2019-11-05
leeccr 2019-10-31
evilvoid 2010-02-02