ant

<?xml version="1.0" encoding="UTF-8"?>
<!-- 主要是web项目打war包 -->
<project basedir="." default="antwar" name="strust1.x">
<!-- 定义两个变量 -->
<property name="myclass" value="WebContent/WEB-INF/classes/"></property>
<property name="libdir" value="WebContent/WEB-INF/lib/"></property>

<!-- 指定一个path 包含所用到的class以及lib目录里的jar -->
<path id="myclasspath">
<fileset dir="${libdir}" />
<pathelement location="${myclass}" />
</path>
<!-- 清理工作 -->
<target name="clean">
<delete dir="${myclass}" />
</target>
<!-- 创建classes目录 将源文件也拷贝到里边 再编译 -->
<target depends="clean" name="build">
<mkdir dir="${myclass}" />
<copy includeemptydirs="false" todir="${myclass}">
<fileset dir="src" />
</copy>
<javac destdir="${myclass}">
<src path="src" />
<classpath refid="myclasspath" />
</javac>
</target>
<!-- 打war包 -->
<target name="antwar" depends="build">
<war warfile="struts1.x.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir="WebContent" />
</war>
</target>
</project>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值