Search code examples
netbeansnetbeans-6.9rcpequinoxapache-felix

Netbeans RCP module options. Felix, equinox or standard Netbenas module?


There are a few options for developing modules for Netbeans 7.0.1 RCP. I haven't found any clear comparison of them. So I would like to know which of them is the easiest to:

  • develop

  • install by user (e.g. user could choose proper jar with module
    from a repository )

Which makes to write less non-reusable code (e.g. when you want to make web application of used classes later)?

Which is the most popular?


Solution

  • The easiest way is to use the traditional Netbeans way - build nbm's. This is well tested and good feature. After building module you will get the "nbm" file with all needed info inside (additional jars, settings, etc.)

    You can use "Module Update" features from Netbeans.

    The other way is to build modules as osgi bundles. This feature was introduced in 6.7 version and up to now it has some problems.

    First of all, bundle in normal understanding is one jar. If your bundle depends on other jar (f.e. apache-commons:beanutils), you will need to pack this jar into your bundle jar (using maven-bundle-plugin) or to install "beanutils" as independent bundle. The first solution is not the best, because if in the future another bundle wants to use "beanutils" you will need to link new bundle with old one, even if they don't need this. This cause high cohesion between modules. Or you can pack "beanutils" into your new bundle, but this can cause classloading issues in osgi-framework.

    So, if you need to install netbeans module, you just install one nbm file and that's all.

    If you need to install bundle, you need to install all dependent bundles separately beside yours bundle.

    Another things are, for now you can't configure osgi-framework, which embedded in netbeans and process of loading bundles has some differences from loading standard netbeans modules which can cause some "strange" issues.

    I'm sure that guys from netbeans will fix this issues and they are moving in right direction, but for now, if you don't need bundles, don't use it.