配置ANT

下载

http://www.apache.org/dist/ant/binaries下的apache-ant-1.8.1-bin.zip 解压到本地磁盘目录下。
ant的配法:
解压ant的包到本地目录。
b在环境变量中设置ANT_HOME,值为你的安装目录, 把ANT_HOME/bin加到你系统的path目录中去。
c 在环境变量中设置JAVA_HOME,值为你的jdk安装目录。
d 在你的ANT_HOME/bin目录下ant.bat文件中添加两行内容:
set ANT_HOME=D:\F:\apache-ant-1.8.1\(ant的安装目录)
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_20 (jdk的安装目录)
在cmd模式下输入 ant -version回车,看到输出“Apache Ant version 1.8.1 compiled on April 30 2010”说明配置成功。
使用ANT生成war文件

这个用法在为Spring框架资源包下的jpetstore项目打包时可以用到,在DOS下

F:\>cd F:\spring-framework-2.5.6\samples\jpetstore

F:\spring-framework-2.5.6\samples\jpetstore>ant warfile
Buildfile: F:\spring-framework-2.5.6\samples\jpetstore\build.xml

build:
    [javac] F:\spring-framework-2.5.6\samples\jpetstore\build.xml:77: warning: '
includeantruntime' was not set, defaulting to build.sysclasspath=last; set to fa
lse for repeatable builds

warfile:
      [war] Building war: F:\spring-framework-2.5.6\samples\jpetstore\dist\jpets
tore.war

BUILD SUCCESSFUL
Total time: 2 seconds

如果运行结果如上,那么将在jpetstore\dist目录下产生jpetstore.war

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值