The nuts and bolts of module dependencies are as follows:
What this means is that if
then a NoClassDefFoundException will be thrown at runtime (there is work happening to check this at build time too). A minor caveat to the second item is if Module B declares an implementation dependency on module A - then it will have access to the full set of classes (but it will be hard to upgrade B independent of A). Normally you don't need to do this.
Modules can also load classes from libraries - JAR files that are packaged with the module (see how to package libraries ). The following things are true about libraries:
If you are using module development support in 5.0, you will manage module dependencies on the properties pane for your module. For those who are interested, what this does in the background is to modify yourmodule/nbproject/project.xml. The data saved there is then used to generate the appropriate manifest entries for you.
If you need to do this manually, the following manifest entries are relevant:
OpenIDE-Module-Module-Dependencies:is followed by a comma-delimited list of module code-names.
OpenIDE-Module-Public-Packages:is followed by a comma delimited list of packages in your module (or in a library your module references by a Class-Path: entry). In a 5.0 or greater module, these manifest lines are generated from $MODULE_HOME/nbproject/project.xml; right click your project and choose Properties for a human-friendly way of editing this file.
If you are using NB 5.0's module building support, you don't need to manually edit either of these entries - the IDE will do it for you.
If you are writing a module that will use some third party libraries, you probably want to read the section on wrapper libraries and also how to use them.
For the full gory detail, see the reference documentation about classloading in NetBeans
Note that a module can declare very specific dependencies - i.e. that it must have version n.n or greater of some module. It is also necessary to depend on the release version if present (the /1 you see as part of the name of some modules).