You can define a keyboard shortcut or even a toolbar button or menu item that will trigger any Ant target.

  1. Open build.xml and add your custom Ant target.
  2. When build.xml is open, you can see the list of all targets in the Navigator or Files windows.
  3. Right-click any of these targets and select Create Shortcut. A wizard appears that lets you configure your shortcut. For instance, you can also add a menu item or a toolbar button for the Ant target.

Each time you invoke the shortcut, the corresponding Ant target is executed.

Source: NetBeans User FAQ