Previous Next |
Configuring Ant in Eclipse Eclipse also lets you configure its internal version of Ant. To configure how Ant will run, select Window Screenshot-7. Configuring the build file![]() You can also set Ant runtime options by selecting the Runtime node, as shown in Screenshot-8. For example, to use a more recent version of Ant in Eclipse (Eclipse 2.1.1 comes with Ant 1.5.3, but the latest version of Ant, as of this writing, is 1.5.4, and Version 1.6 is out in beta; you can get alternate Ant versions directly from Apache at http://ant.apache.org), select the Runtime item and change the JAR entries you see in Screenshot-8 to the new versions of ant.jar and optional.jar. You can also set Ant variables like ANT_HOME in this dialog. Screenshot-8. Configuring Ant in Eclipse![]() You can add new Ant tasks and types with the Tasks and Types tabs, which means that those tasks and types will be available to build files without having to use Ant taskdef or typedef elements. Eclipse also lets you set global Ant properties if you select the Properties tab in this dialog. To add a new global property, click the Add button in the Properties tab, and enter a name and value for the new property. You also have limited control over the Ant editor's options using the Preferences dialog and selecting the Ant Screenshot-9. Configuring the Ant editor![]()
You can also configure Ant when you're about to run it, before selecting an Ant target to build. Right-click build.xml, select Run Ant, and click the Main tab in the dialog that opens, as shown in Screenshot-10. You can set the location of the build file you want to use here, as well as the base directory for the build. You can also set Ant arguments in the Arguments field. Screenshot-10. Setting the run configuration![]()
In addition, there's also an Ant view in Eclipse, which you open with Window Screenshot-11. The Ant view![]() |
Previous Next |