ant用法

<?xml version="1.0"?>
<project name="hr" default="war" basedir=".">
 <property name="classes" value="build/classes"/>
 <property name="build" value="build"/>
 <property name="lib" value="WebRoot/WEB-INF/lib"/>
  <path id="classpath">
       <pathelement location="${build}/WEB-INF/classes"/>
         <fileset dir="lib">
             <include name="*.jar"/>
         </fileset>
       <pathelement location="xml"/>
        
  </path>
 
 <target name="clean">
  <delete dir="${build}"></delete>
 </target>
 <target name="prepare" depends="clean">
  <mkdir dir="${build}/WEB-INF"/>
  <mkdir dir="${build}/WEB-INF/classes"/>
  <mkdir dir="${build}/WEB-INF/jsp"/>
  <mkdir dir="${build}/WEB-INF/lib"/>
 </target>
 
 <target name="copyjars">
  <copy todir="${build}/WEB-INF/lib">
   <fileset dir="lib">
    <include name="**/*.jar"/>
    <include name="**/*.dtd"/>
   </fileset>
  </copy>
 </target>
 
 <target name="compile" depends="prepare">
  <javac srcdir="src" destdir="${build}/WEB-INF/classes">
   <classpath refid="classpath"></classpath>
  </javac>
  
 </target>
 
 <target name="test" depends="compile">
 
   <junit printsummary="on"
    haltonfailure="false"
    failureproperty="tests.failed"
    showoutput="true">
    
    <classpath refid="classpath"/>
    <formatter type="plain" usefile="true"/>
     <test name="org.yeeku.test.AuctionTest"></test>
   
   </junit>
  

  
  </target>
 
 <target name="build" depends="test,prepare,copyjars,compile">
  <copy todir="${build}/WEB-INF">
   <fileset dir="WebRoot/WEB-INF">
    <include name="*.xml"/>
    <include name="*.tld"/>
   </fileset>
  </copy>
  <copy todir="${build}">
   <fileset dir="WebRoot">
    <include name="**/*.jsp"/>
   </fileset>
  </copy>
  <copy todir="${build}/images">
   <fileset dir="WebRoot/images">
     <include name="**/*.jpg"/>
    <include name="**/*.png"/>
    <include name="**/*.css"/>
    <include name="**/*.gif"/>
   </fileset>
  </copy>
  <copy todir="${build}/WEB-INF/classes">
   <fileset dir="src">
    <include name="**/*.properties"/>
    <include name="**/*.xml"/>
    <exclude name="**/*.java"/>
   </fileset>
  </copy>
 </target>
 
 <target name="war" depends="build">
  <war destfile="${build}/hr.war"
   basedir="${build}">
   
   
  
   
  </war>
 </target>

 

 
</project>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值