Adding More Power to Menus in NetBeans IDE 4.1
By Geertjan on May 15, 2005
Here is a complete list of these targets:
-pre-init: called before initialization of project propertie -post-init: called after initialization of project properties -pre-compile: called before javac compilation -post-compile: called after javac compilation -pre-compile-single: called before javac compilation of single file -post-compile-single: called after javac compilation of single file -pre-compile-test: called before javac compilation of JUnit tests -post-compile-test: called after javac compilation of JUnit tests -pre-compile-test-single: called before javac compilation of single JUnit test -post-compile-test-single: called after javac compilation of single JUunit test -pre-jar: called before JAR building -post-jar: called after JAR building -post-clean: called after cleaning build products
The one I've found most useful so far is -post-jar. In so many situations, such as when developing NetBeans Modules, one needs a JAR file before going any further. And for these situations this target is really useful. You can just refer to any of your own targets in this target, and it will be executed after the JAR is created, which happens when the Build Project menu is used. This means that you've actually added your own targets to the Build Project menu. For example, this is how I build NetBeans Modules:
<target name="-post-jar" depends="create-xml-file-for-module,create-nbm,reload" />
So, the revelation for me was that even though standard projects are limited in that they don't allow for customized contextual menus, the existing contextual menus can be extended, to the extent that my not being able to create my own contextual menus for standard projects doesn't make much difference.