Ant 简明教程
Ant - Eclipse Integration
如果您已经下载并安装了 Eclipse,您几乎不用做任何事情就可以开始。Eclipse 与 Ant 插件捆绑在一起,开箱即用。
If you have downloaded and installed Eclipse already, you have very little to do to get started. Eclipse comes pre bundled with the Ant plugin, ready to use.
按照如下简单步骤,可将 Ant 集成到 Eclipse 中。
Follow the simple steps, to integrate Ant into Eclipse.
-
Make sure that the build.xml is a part of your java project, and does not reside at a location that is external to the project.
-
Enable Ant View by following Window → Show View → Other → Ant → Ant.
-
Open Project Explorer, drag the build.xml into the Ant View.
您的 Ant 视口与此给定视口类似 −
Your Ant view looks similar to the one given below −

点击 target,build/clean/usage 将使用 target 运行 Ant。
Clicking on the targets, build / clean / usage will run Ant with the target.
点击“传真”将执行默认 target - usage 。
Clicking "fax" will execute the default target - usage.
Ant Eclipse 插件还带有适合编辑 build.xml 的好编辑器。该编辑器了解 build.xml 架构并且可以帮助您完成代码。
The Ant Eclipse plugin also comes with a good editor for editing build.xml files. The editor is aware of the build.xml schema and can assist you with code completion.
要使用 Ant 编辑器,右击您的 build.xml(来自 Project Explorer),然后选择 Open with > Ant Editor。Ant 编辑器应类似此样式 −
To use the Ant editor, right click your build.xml (from the Project Explorer) and select Open with > Ant Editor. The Ant editor should look something similar to−

Ant 编辑器在右侧列出 target。target 列表用作书签,以允许您直接跳到特定 target 编辑中。
The Ant editor lists the targets on the right hand side. The target list serves as a bookmark that allows you to jump straight into editing a particular target.