使用ant build进行增量打包
<?xml version="1.0" encoding="gb2312"?>
<project name="delploy" default="buding_new" basedir=".">
<!-- ================================================================== -->
<!-- 初始化属性 -->
<!-- ================================================================== -->
<tstamp/>
<target name="init-properties" description="初始化属性">
<!--<property file="build.properties" />-->
<property name="war.name" value="out" />
<property name="src.dir" value="src" />
<property name="bin.dir" value="out/production/out" />
<!--补丁目标路径 一般默认工程当前路径下面的 AntBuild 目录下-->
<property name="buding_base" value="AntBuild" />
</target> <target name="打包命令" depends="init-properties">
<mkdir dir="${buding_base}/WEB-INF"/>
<delete verbose="true" includeemptydirs="true" >
<fileset dir="${buding_base}" includes="*.*"/>
<fileset dir="${buding_base}/WEB-INF" />
</delete> <!--copy没有打做jar包的classes文件-->
<copy todir="${buding_base}/WEB-INF/classes" overwrite="true" verbose="true">
<fileset dir="./out/production/out" includesfile="patterns.txt" />
</copy> <!--拷贝web,jsp,配置文件(*.xml,*.properties),dtd等,除了class和jar,这里可以通过pattens.add来详细的定义发布文件的格式-->
<copy todir="${buding_base}" overwrite="true" verbose="true">
<fileset dir="." includesfile="patterns.txt" />
</copy> <!--复制后直接对文件用tar 打包-->
<tar destfile="${buding_base}/${war.name}_patch${DSTAMP}_${TSTAMP}.tar" basedir="${buding_base}">
<!--<fileset dir="${buding_base}" includes="*.jsp" />-->
</tar>
</target>
</project>