ant的配置

http://blog.sina.com.cn/s/blog_59833db10100bhm5.html这是我一个朋友写的ant配置说明,下面是我自己写的一个编译一个用struts2写的java类LoginAction的build.xml,里面有编译时需要加载的类库等

 

builder.xml的内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="build" name="struts">
 <property name="src.dir" location="src" />
 <property name="build.dir" location="build" />
 <property name="lib.dir" location="lib" />
 <target name="build">
  <echo message="王荻学习ant" />
  <ant target="init" />
  <ant target="javac" />
  <ant target="jar" />
 </target>
 <target name="init">
  <echo message="文件初始化开始"></echo>
  <mkdir dir="${build.dir}" />
  <mkdir dir="${lib.dir}" />
  <echo message="文件初始化完毕"></echo>
 </target>
 <target name="javac" depends="init">
  <echo message="项目编译开始"></echo>
  <javac srcdir="${src.dir}" destdir="${build.dir}">
   <classpath location="${lib.dir}/commons-fileupload-1.2.1.jar" />
   <classpath location="${lib.dir}/freemarker-2.3.15.jar"/>
   <classpath location="${lib.dir}/xwork-core-2.1.6.jar"/>
   <classpath location="${lib.dir}/commons-logging-1.0.4.jar"/>
   <classpath location="${lib.dir}/struts2-core-2.1.8.1.jar"/>
   <classpath location="${lib.dir}/commons-fileupload-1.2.1.jar"/>
  </javac>
  <echo message="项目编译完毕"></echo>
 </target>
 <target name="jar">
  <jar destfile="${lib.dir}/m.jar" basedir="${build.dir}"></jar>
  <echo>目标文件已经被打成jar包</echo>
 </target>
  <target name="javadocs">
  <mkdir dir="./doc" />
  <javadoc packagenames="com.wang.*" sourcepath="${src.dir}" destdir="./doc">
  </javadoc>
  <echo>java doc 制作完毕</echo>
 </target>
</project>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值