How to add a new library?
Do you want to integrate another third-party library that might be shared among
several NetBeans modules? This is right place to host
it. The following instructions should explain how.
First you need to make sure you have permission to host the library on netbeans.org
at all. Ask on nbdiscuss@netbeans.org if you are not sure.
The pseudo-module should be an autoload module containing just a
Bundle.properties to localize the module
display name and other human-visible text strings, and its
manifest
should contain
a Class-Path entry pointing to the actual library:
Class-Path: ext/qwerty-x.y.z.jar
There is no hard requirement as to which package such a module should be placed in.
It is however recommended that
pseudo-modules use org.netbeans.libs,
e.g. org.netbeans.libs.qwerty for a Qwerty library.
This package should contain the Bundle.properties file
and can serve as the module's code name base.
There are templates for newly created modules. Each module
is placed in its own subdirectory beneath the libs top-level directory,
e.g. libs/qwerty.
Each module should have the following structure:
libs/qwerty/src/org/netbeans/libs/qwerty/Bundle.properties
libs/qwerty/build.xml
libs/qwerty/manifest.mf
libs/qwerty/.cvsignore
You can copy
libs/www/template to
libs/qwerty
(
libs/www/template/Bundle.properties to
libs/qwerty/src/org/netbeans/libs/qwerty/Bundle.properties) and simply
replace all occurrences of
__NAME__ by the real name of library,
qwerty in our
example. Also
__VERSION__ by the current version and
__PACKAGES__ by any
API packages it exports.
To libs/public.properties you will add specification and
implementation versions which are used in your build.xml
and substituted in manifest.mf, e.g.:
libs.qwerty.specification.version=x.y
libs.qwerty.implementation.version=x.y.z
libs.qwerty.jar.path=libs/external/qwerty-x.y.z.jar
And to
libs/build.xml you will add the module name into the list of all hosted
submodules, e.g.:
<property name="sub-modules" value="xerces, qwerty"/>