ant 中文手册--下载安装

来源:百度文库 编辑:神马文学网 时间:2024/04/24 23:57:51
Getting Ant
获取ant
Binary Edition
二进制版本
The latest stable version of Ant is available from the Ant web pagehttp://ant.apache.org/. If you like living on the edge, you can download the latest version fromhttp://cvs.apache.org/builds/ant/nightly/.
您可以从ant主页获取最新的ant版本http://ant.apache.org/,如果你在边缘地区, 您可以从这个地址获取最新版本:http://cvs.apache.org/builds/ant/nightly/
Source Edition
源码版本
If you prefer the source edition, you can download the source for the latest Ant release fromhttp://ant.apache.org/srcdownload.cgi. Again, if you prefer the edge, you can access the code as it is being developed via CVS. The Jakarta website has details onaccessing CVS. Please checkout the ant module. See the sectionBuilding Ant on how to build Ant from the source code. You can also access theAnt CVS repository on-line.
如果您比较钟意源码版本, 您可以从这个地址获取最新的release版:http://ant.apache.org/srcdownload.cgi,再说一次, 如果您住在边缘地区, 可以用CVS方式来获取源码版本,Jakarta主页上有详细资料:  accessing CVS。您可以通过check out ant项目方式来获取,请参照Building Ant章节来学习怎样编译源码, 您也可以通过这个网站Ant CVS repository来获得源码。
System Requirements
系统要求
Ant has been used successfully on many platforms, including Linux, commercial flavours of Unix such as Solaris and HP-UX, Windows 9x and NT, OS/2 Warp, Novell Netware 6 and MacOS X.
Ant成功地应用于多个平台, 包含Linux,商业Unix 如: Solaris 和 HP-UX, Windows 9x 和 NT, OS/2, Novell Netware 6 和MacOS X.。
To build and use Ant, you must have a JAXP-compliant XML parser installed and available on your classpath.
为了您可以使用ant来编译和构建代码, 您必须有一个遵循JAXP标准的xml解释器,这个解释器路径应该包含在您的classpath里面。
The binary distribution of Ant includes the latest version of theApache Xerces2 XML parser. Please seehttp://java.sun.com/xml/ for more information about JAXP. If you wish to use a different JAXP-compliant parser, you should remove xercesImpl.jar and xml-apis.jar from Ant‘s lib directory. You can then either put the jars from your preferred parser into Ant‘s lib directory or put the jars on the system classpath.
二进制的发布版本里面包含了一个Apache Xerces2的XML解释器,您可以在http://java.sun.com/xml/ 获取更多的JAXP信息,如果您希望用不同的XML解释器,您就得从ant的lib目录中移除xercesImpl.jar 和 xml-apis.jar,同时您必须把你的xml解释器的lib放在ant的lib或系统的classpath里面。
For the current version of Ant, you will also need a JDK installed on your system, version 1.2 or later.
现在的ant版本, 你必须安装了jdk 1.2或更高版本
Note: The Microsoft JVM/JDK is not supported.
注意:微软的jvm/jdk是不支持的
Note #2: If a JDK is not present, only the JRE runtime, then many tasks will not work.
注意2:如果您安装的仅仅是JRE运行环境, 很多Ant的任务将不能正常工作
Installing Ant
安装ant
The binary distribution of Ant consists of the following directory layout:
ant   +--- bin  // contains launcher scripts   |   +--- lib  // contains Ant jars plus necessary dependencies   |   +--- docs // contains documentation   |      +--- ant2    // a brief description of ant2 requirements   |      |   |      +--- images  // various logos for html documentation   |      |   |      +--- manual  // Ant documentation (a must read ;-)   |   +--- etc // contains xsl goodies to:            //   - create an enhanced report from xml output of various tasks.            //   - migrate your build files and get rid of ‘deprecated‘ warning//   - ... and more ;-)二进制的ant由一下目录组成:ant   +--- bin  // 包含一些启动命令   |   +--- lib  // 包含ant运行需要的一些jar文件   |   +--- docs // 包含文档   |      +--- ant2    // 一个大纲式的描述   |      |   |      +--- images  // html里面用的标志   |      |   |      +--- manual  // ant文档(一定要读:)   |   +--- etc   Only the bin and lib directories are required to run Ant. To install Ant, choose a directory and copy the distribution file there. This directory will be known as ANT_HOME.
只有bin和lib目录是运行ant所必须的,选择一个目录, 将所有发布文件拷贝进去, 同时把这个目录设置成ANT_HOME.
Windows 95, Windows 98 & Windows ME Note:
Windows 95, Windows 98 & Windows ME 注意事项
On these systems, the script used to launch Ant will have problems if ANT_HOME is a long filename (i.e. a filename which is not of the format known as "8.3"). This is due to limitations in the OS‘s handling of the "for" batch-file statement. It is recommended, therefore, that Ant be installed in a short, 8.3 path, such as C:\Ant.
这些操作系统,使用一个快捷方式来运行ant时, 可能会应为长文件名而失败, 所以安装的时候尽量安装在8.3标准的目录里面:象c:\ant
On these systems you will also need to configure more environment space to cater for the environment variables used in the Ant lauch script. To do this, you will need to add or update the following line in the config.sys file
这些操作系统可能需要设置更多的环境变量来运行ant快捷方式, 您可能要在config.sys文件里面加入一行:
shell=c:\command.com c:\ /p /e:32768
Setup
安装
Before you can run ant there is some additional set up you will need to do:
在您可以运行ant前, 还有一些额外的设置要做:
Add the bin directory to your path. 增加ant bin目录到您的path里面 Set the ANT_HOME environment variable to the directory where you installed Ant. On some operating systems the ant wrapper scripts can guess ANT_HOME (Unix dialects and Windows NT/2000) - but it is better to not rely on this behavior. 将ant安装目录设置成 ANT_HOME环境变量,在有些操作系统里面, ant可以推算ant_home, 但是不要依赖他 Optionally, set the JAVA_HOME environment variable (see theAdvanced section below). This should be set to the directory where your JDK is installed. 作为一个可选操作, 您必须设置JAVA_HOME环境变量,将你的jdk安装目录设置成JAVA_HOME。
Note: Do not install Ant‘s ant.jar file into the lib/ext directory of the JDK/JRE. Ant is an application, whilst the extension directory is intended for JDK extensions. In particular there are security restrictions on the classes which may be loaded by an extension.
注意:不要把ant的ant.ja安装到jdk的lib/ext中,Ant是一个应用程序,jdk的扩展目录是用来扩展jdk的,当ant被当作一个扩展来使用,将有安全限制。