一个 build.xml 文件

本文介绍了一个使用Ant进行Struts项目构建的配置示例。详细展示了如何设置项目的属性,包括部署目录、源代码目录等,并定义了清理、构建基本目录及编译源代码的目标。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<?xml version="1.0" encoding="utf-8"?>
<project name="struts" default="compile_src" basedir=".">
<property environment="env"/>
<property name="deploy_web.dir" value="${env.CATALINA_HOME}/webapps/"/>
<property name="src.dir" value="../struts/src/"/>
<property name="webRoot.dir" value="../struts/webRoot/"/>
<property name="classes.dir" value="${webRoot.dir}/WEB-INF/classes/"/>
<property name="lib.dir" value="${webRoot.dir}/WEB-INF/lib/"/>

<target name="deploy_web" depends="build_base_dir,compile_src">
<!--
<antcall target="clear_dir"/>
<antcall target="build_base_dir"/>
<antcall target="compile_src"/>
-->
</target>

<target name="build_base_dir">
<mkdir dir="${deploy_web.dir}/struts/"/>
<copy todir="${deploy_web.dir}/struts/">
<fileset dir="${webRoot.dir}"/>
</copy>
</target>

<target name="compile_src" depends="build_base_dir">
<javac encoding="utf-8" srcdir="${src.dir}" destdir="${deploy_web.dir}/struts/WEB-INF/classes" classpathref="classpath.web" source="1.5" debug="true" debuglevel="lines,vars,source"/>
</target>

<target name="clear_dir">
<delete dir="${deploy_web.dir}/struts/" quiet="true"/>
</target>

<path id="classpath.web">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
</project>

[quote]http://blog.youkuaiyun.com/hamenny/archive/2009/04/02/4044296.aspx[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值