Using the Ant view

Eclipse provides a standard view, the Ant view, that lets you work with your Ant buildfiles. This view is tree-structured, showing Ant buildfiles as top-level entries and targets & internal targets as children. The main advantage of this view is that you can work with all of your Ant buildfiles in one place, as opposed to hunting them down in one of the navigation views.

  1. Open the Ant view from the workbench menu by selecting Window > Show View > Ant.
  2. By default, the Ant view is empty. There are three ways to add Ant buildfiles to this view:
  3. Click Add Buildfiles with Search. Suppose you only remember that the buildfile you want to work with starts with 'H'. Enter 'H*.xml' for the buildfile name. Make sure Workspace is selected for the scope, then click Search. The HelloWorld.xml file is found and placed in the Ant view.
  4. Expand the top-level entry to see the default target Hello, and the internal target World.
    Ant view
  5. Select the World internal target and click Run the Selected Target Ant view. Notice that just the World target gets executed.
  6. Select the top-level HelloWorld buildfile and click Run the Default Target of the Selected Buildfile Ant view. Notice that just the default target, Hello, gets executed.
  7. To edit your buildfile, bring up the context menu on the HelloWorld file and select Open With > Ant Editor.
  8. To edit the default launch configuration, select Run As > Ant Build... from the context menu.
  9. The Run Ant launch configuration dialog appears. Here you can modify the way in which the buildfile is run from the Ant view.
  10. Select the HelloWorld file, then click the Remove button. The buildfile is removed from the view.
    Note: This does not delete the file from the workspace.