NBM allows to declare its own custom code in NBM archive. This code is called-back by Autoupdate/Updater at the end of installation of NBM into IDE.
your_module.nbm
|
+- Info
| |
| +--- info.xml
|
+- netbeans
|
+--- modules...
|
+-main
|
+--- main.properties
+--- <custom code>
If Autoupdate/Updater detects main directory in the NBM archive then main.properties descriptor contains information about the own code. Updater runs specified Java code according to these properties.
The properties expected in main.properties are:
| Property | Value |
|---|---|
| mainClass | name of the main class, run after module installation from the NBM |
| relativeClassPath | classpath elements, may contain more elements |
| jvm.parameters | properties for JVM, arguments inserted before the main class name |
| mainClass.arguments | more arguments for the main class, added after the main class name |
The run command is built on top of properties above.
The properties can contain several special variables which Autoupdate replaces by real values:
| Variable | Value |
|---|---|
| %IDE_HOME% | platform directory |
| %IDE_USER% | user directory [1] |
| %FS% | file separator char |
| %JAVA_HOME% | the current Java home |
To see that samplepostinstall project in action
I'm not author of this feature, it's only my investigation.
Do not hesitate to contact me on mailto:jrechtacek@netbeans.org if you have any question.
| org-netbeans-samplepostinstall.nbm | ![]() |
13925 bytes |
| samplepostinstall.zip | ![]() |
17567 bytes |