Skip to main content

Netbeans and Ant -- it's a wonderful union

Posted by rbair on October 7, 2005 at 10:56 AM PDT

I've been developing with NetBeans for almost a year now. I always thought the Ant integration was pretty good. Today I found a new integration feature that I didn't know existed before, but was really cool. So I thought I'd share.

In NetBeans, for any project that has a build.xml file, click on the "Files" tab, and then select build.xml. Now, check out the Navigator (if the Navigator window isn't open, choose Window | Navigator, or ctrl+7). The Navigator should show all of the ant targets available in the build.xml file (including targets in included build files).

Now for the fun part. Click some target (if you're using swinglabs build.xml file, click "get-from-cvs"). Right click the selected target and choose "Create Shortcut...". Now, you can choose to associate that target for that build.xml file with a menu item, toolbar button, etc! I created a special "Build SwingLabs" button on my toolbar.