Mapping an Ant Target to an IDE Command

See Also 

In a , IDE commands need to be mapped to targets in your Ant script. These mappings are recorded in the project.xml file in your project folder.

Mappings are recorded in the project.xml file automatically in these cases:

You can also use the Project Properties dialog box to add a shortcut to any Ant target to the project node's contextual menu. For example, if you have several runnable classes that you need to run often, you can write targets to run these classes and then run them using the links.

You map other commands, like those that run on individual files, by manually editing project.xml.

Mapping Commands for a Project:

  1. In the Projects window, right-click the project node and choose Properties.
  2. Click Build and Run in the right panel of the Project Properties dialog box.
  3. For each command, choose an Ant target from the combo box. The combo box contains each of the targets in your Ant script.
  4. Use the Custom Menu Items list to add shortcuts to Ant targets to the project's contextual menu.

Mapping IDE Commands in project.xml:

  1. In the Files window, expand the node for your project folder and expand the nbproject folder.
  2. Double-click project.xml to open it in the Source Editor.
  3. Enter the following in <ide-actions>:
      <action name="action_name">
        <target>target_name</target>
      </action>

    You can map any of the following IDE actions:

  4. If you also want the command to appear in the project's contextual menu, enter the following in <context-menu>:
      <ide-action name="action_name"/>

For a full guide to configuring free-form projects, see:

See Also
About Free-Form Projects
Creating A Debug Target for a Free-Form Java Project
Creating A Debug Target for a Free-Form Web Project
Storing IDE Targets in a Separate Ant Script

Legal Notices