`
zhaole609
  • 浏览: 339567 次
  • 性别: Icon_minigender_1
  • 来自: 河南
社区版块
存档分类
最新评论

ant配置方法

阅读更多
从http://ant.apache.org/下载Ant工具,解压以下方法配置.

apache-ant-1.8.1接压安装。


ant的配置:
1。解压ant的包到本地目录。
2。在环境变量中设置ANT_HOME,值设为你的安装目录。
3。在环境变量中设置JAVA_HOME,值设为你的jdk安装目录。
4。把ANT_HOME/bin加到你系统的path目录中去。


ANT_HOME=D:\jakarta-ant-1.7.1 //注意是Ant的安装目录,不是bin子目录
PATH=%PATH%;%ANT_HOME%\bin;
是不是与java配置很像呀,当然了...



在cmd模式下输入 ant -version回车,看到输出说明配置成功。
运行Ant非常简单,(当你正确地安装Ant后)只要输入ant就可以了。


ex:>ant -version
Apache Ant version 1.7.1 compiled on June 27 2008


n 没有指定任何参数时,Ant会在当前目录下查询build.xml文件。如果找到了就用该文件作为buildfile。如果你用 -find 选项。Ant就会在上级目录中寻找buildfile,直至到达文件系统的根。要想让Ant使用其他的buildfile,可以用参数 -buildfile file,这里file指定了你想使用的buildfile。


n 可以指定执行一个或多个target。当省略target时,Ant使用标签<project>的default属性所指定的target。
命令行选项总结:
ant [options] [target [target2 [target3] ...]]
Options:
-help print this message
-projecthelp print project help information
-version print the version information and exit
-quiet be extra quiet
-verbose be extra verbose
-debug print debugging information
-emacs produce logging information without adornments
-logfile file use given file for log output
-logger classname the class that is to perform logging
-listener classname add an instance of class as a project listener
-buildfile file use specified buildfile
-find file search for buildfile towards the root of the filesystem and use the first one found
-Dproperty=value set property to value
例子
ant
使用当前目录下的build.xml运行Ant,执行缺省的target。
ant -buildfile test.xml
使用当前目录下的test.xml运行Ant,执行缺省的target。
ant -buildfile test.xml dist
使用当前目录下的test.xml运行Ant,执行一个叫做dist的target。
ant -buildfile test.xml -Dbuild=build/classes dist
使用当前目录下的test.xml运行Ant,执行一个叫做dist的target,并设定build属性的值为build/classes。

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/lesorb/archive/2008/10/14/3072523.aspx
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics