<?xml version="1.0" encoding="UTF-8"?>
<project name="${webapp.name}" default="version" basedir=".">
<target name="shutdowntomcat" >
<exec executable="${basedir}/bin/shutdown.bat" failοnerrοr="false"></exec>
</target>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" />
<svnSetting id="svn.setting" svnkit="true" username="username" password="password" javahl="false" />
<target name="svn.update" depends="shutdowntomcat">
<svn refid="svn.setting">
<update dir="${basedir}/XXXXXX" />
</svn>
</target>
<target name="clean" depends="svn.update">
<delete failοnerrοr="false" verbose="true" includeEmptyDirs="true">
<fileset dir="${basedir}/XXXXXX/build" />
<fileset dir="${basedir}/XXXXXX/WebRoot/WEB-INF/classes" />
<fileset dir="${basedir}/webapps/XXXXXX" />
<fileset file="${basedir}/webapps/XXXXXX.war" />
</delete>
<mkdir dir="${basedir}/XXXXXX/build" />
</target>
<path id="project.lib">
<fileset dir="${basedir}/XXXXXX/WebRoot/WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="compile" depends="clean">
<javac srcdir="${basedir}/XXXXXX/src" destdir="${basedir}/XXXXXX/build" encoding="UTF-8" includeantruntime="false">
<compilerarg line=" -encoding UTF-8 -Xlint:unchecked -nowarn " />
<classpath refid="project.lib" />
</javac>
<copy todir="${basedir}/XXXXXX/build">
<fileset dir="${basedir}/XXXXXX/resource">
<exclude name="database/**" />
<exclude name="config.properties" />
</fileset>
</copy>
<move file="${basedir}/XXXXXX/build/config.properties_F" tofile="${basedir}/XXXXXX/build/config.properties" />
</target>
<target name="war" depends="compile">
<war destfile="${basedir}/webapps/XXXXXX.war" webxml="${basedir}/XXXXXX/WebRoot/WEB-INF/web.xml">
<fileset dir="${basedir}/XXXXXX/WebRoot"></fileset>
<classes dir="${basedir}/XXXXXX/build"></classes>
</war>
</target>
<target name="startuptomcat" depends="war">
<exec executable="${basedir}/bin/startup.bat" failοnerrοr="false"></exec>
</target>
<target name="version" depends="startuptomcat">
<typedef resource="com/googlecode/svntask/svntask.xml" />
<svn>
<info path="${basedir}/XXXXXX" revisionProperty="revisionVersion" />
</svn>
<property name="version" value="${revisionVersion}" />
<echo message="version:${version}" />
</target>
</project>
ant实现自动化部署
最新推荐文章于 2024-05-22 10:17:41 发布