build.xml
dist为开发环境,dist-Product为生产环境
<project name="teststrutsspring" basedir="." default="dist">
<property file="build.properties" />
<property file="version.properties" />
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="lib.dir" location="WebRoot/WEB-INF/lib" />
<property name="web" location="WebRoot" />
<target name="dist" description="Generate the distribution">
<antcall target="clean" />
<antcall target="init" />
<antcall target="getVersion" />
<antcall target="compile" />
<antcall target="copyother" />
<antcall target="jar" />
<antcall target="jarclientapi" />
<antcall target="war" />
</target>
<target name="dist-Product" description="Generate the Product">
<antcall target="clean" />
<antcall target="init" />
<antcall target="getVersion" />
<antcall target="compile" />
<antcall target="copyother" />
<antcall target="copy-product-env-config" />
<antcall target="jar" />
<antcall target="war" />
<echo>Generate the product environment!</echo>
</target>
<target name="init">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
</target>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="getVersion">
<propertyfile file="version.properties" comment="This is Version File">
<entry key="buildDate" type="date" value="now" pattern="yyyy-MM-dd HH:mm:ss" />
</propertyfile>
<property file="version.properties" />
<copy todir="${build}">
<fileset dir=".">
<include name="version.properties" />
</fileset>
</copy>
</target>
<path id="all-libs">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="compile" description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" encoding="UTF-8" nowarn="true" source="1.5">
<classpath refid="all-libs" />
</javac>
</target>
<target name="copyother">
<copy todir="${build}">
<fileset dir="${src}">
<include name="**/**" />
<exclude name="**/*.java" />
<exclude name="*.properties" />
<exclude name="*.xml" />
</fileset>
</copy>
<copy todir="${dist}/${webname}">
<fileset dir="${web}">
<include name="**/*" />
<exclude name="**/WEB-INF/classes/**" />
</fileset>
</copy>
<copy todir="${dist}/${webname}/WEB-INF/classes">
<fileset dir="${src}">
<include name="*.properties" />
<include name="*.xml" />
</fileset>
</copy>
</target>
<target name="jar" description="Generate the distribution">
<jar jarfile="${dist}/${projectname}-${version}.jar" basedir="${build}" compress="true">
</jar>
<copy todir="${dist}/${webname}/WEB-INF/lib">
<fileset dir="${dist}">
<include name="${projectname}-${version}.jar" />
</fileset>
</copy>
</target>
<target name="jarclientapi" description="Generate the jar client api">
<jar jarfile="${dist}/${clientapiname}-${version}.jar" compress="true">
<fileset dir="${build}">
<include name="**/*.class" />
</fileset>
</jar>
</target>
<target name="copy-product-env-config">
<copy todir="${dist}/${webname}/WEB-INF/classes" overwrite="true">
<fileset dir="ProductEnv-Config">
<include name="*.properties" />
</fileset>
</copy>
</target>
<target name="war">
<war basedir="${dist}/${webname}" warfile="${dist}/${webname}.war" webxml="${dist}/${webname}/WEB-INF/web.xml" compress="false">
</war>
</target>
</project>
build.properties
projectname=teststrutsspring
webname=teststrutsspring
clientapiname=teststrutsspring-pojo
version.properties
#This is Version File
#Fri Sep 10 11:05:45 CST 2010
version=1.0.0
buildDate=2010-09-10 11\:05\:45
分享到:
相关推荐
NULL 博文链接:https://kanpiaoxue.iteye.com/blog/1995837
jmeter+ant 持续集成build.xml文件,直接使用ant命令执行jmeter脚本文件,得到图形测试报告
ant做的一个小例子,里面有build.xml的详细配置,导入myEclipse后可直接运行。
Python写的一个程序,可以生成java开发中ANT工具所需的build.xml文件。
对build.xml文件中用到的标签进行了详尽的解说,并且附有例子,ant build.xml文件详解
演示 build.xml 是编写方法,适合 ant build 初学者,解压,进入 ant 目录, 运行命令 ant 既可
我的开发环境是Eclipse,ant.xml是放在项目下的ant(新建),也可以修改project的basedir.
NULL 博文链接:https://siwind.iteye.com/blog/1473839
第一次做jmeter+ant自动化接口测试,需要build文件,开始直接copy博客中的内容,格式不对,调试好久不成功;后发现在jmeter/extras文件夹中有一个build文件,copy出来根据需要修改下,成功了,特上传自选供大家使用...
开源ant的build.xml的一些属性配置,内含 几个例子。比较实用
ant +build.xml 文件Jenkins部署javaEE项目,助力成功自动化部署。ant +build.xml 文件Jenkins部署javaEE项目,助力成功自动化部署。ant +build.xml 文件Jenkins部署javaEE项目,助力成功自动化部署。ant +build.xml...
ANT-build.xml文件详解 ANT-build.xml文件详解 ANT-build.xml文件详解 ANT-build.xml文件详解
xdoclet 配置文件,可以自动建立hibernate配置文件和mapping文件
ant build.xml demo 供自己及好友学习,能很快上手
Ant_build.xml配置实例,Ant的详细配置,很实用
jmeter+ant+jenkins---build.xml文件,下载运行即可成功
一个普通java程序用ant打包的列子,完整的,里面采用的是eclipse自带的编译插件进行的打包,需要结合eclipse中的插件一起使用
jmeter实现接口自动化测试: 1)buil.xml文件实现了测试报告和发邮件 2)优化后的报告模板:jmeter-results-newreport.xsl
ANT Build.xml 自动编译