添加时间:[2010-9-2 18:24:04]
1.ant包解压到安装目录。
2.环境变量中设置 ANT_HOME , 值为安装目录。
3.环境变量中设置 JAVA_HOME , 值为 jdk 安装目录。
4.把 ANT_HOME 添加到 Path 变量中去,值为“%ANT_HOME%\bin;”。
在cmd模式下输入 ant -version回车,看到输出说明配置成功。
运行Ant非常简单,(当你正确地安装Ant后)只要输入ant就可以了。
ex:>ant -version
Apache Ant version 1.8.1 compiled on April 30 2010
ant执行参数:
ant --help 在dos窗口下获得ant运行参数帮助。
没有指定任何参数时,Ant会在当前目录下查询build.xml文件。如果找到了就用该文件作为buildfile。如果你用 -find 选项。Ant就会在上级目录中寻找buildfile,直至到达文件系统的根。要想让Ant使用其他的buildfile,可以用参数 -buildfile file,这里file指定了你想使用的buildfile。
可以指定执行一个或多个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。
|
Java下的ant配置
作者无: 加入时间:2010-9-2 18:24:04 点击次数:433 次ant 配置:
1.ant包解压到安装目录。 2.环境变量中设置 ANT_HOME , 值为安装目录。 3.环境变量中设置 JAVA_HOME , 值为 jdk 安装目录。 4.把 ANT_HOME 添加到 Path 变量中去,值为“%ANT_HOME%\bin;”。 在cmd模式下输入 ant -version回车,看到输出说明配置成功。 运行Ant非常简单,(当你正确地安装Ant后)只要输入ant就可以了。 ex:>ant -version Apache Ant version 1.8.1 compiled on April 30 2010 ant执行参数: ant --help 在dos窗口下获得ant运行参数帮助。 没有指定任何参数时,Ant会在当前目录下查询build.xml文件。如果找到了就用该文件作为buildfile。如果你用 -find 选项。Ant就会在上级目录中寻找buildfile,直至到达文件系统的根。要想让Ant使用其他的buildfile,可以用参数 -buildfile file,这里file指定了你想使用的buildfile。 可以指定执行一个或多个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。 上一篇: |
|||||