Search code examples
javamavennetbeansconfigurationnetbeans-platform

How to set the cluster for my NetBeans Modules Maven


This seems to be a simple thing, but I can't figure out why some of the modules I created end up in different clusters (i.e. ide) and others on the cluster by my branding token.

The only module that shows under the branding token has this configuration:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>nbm-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <moduleType>autoload</moduleType>
                <codeNameBase>com.validation.manager.h2/1</codeNameBase>
                <publicPackages>
                    <publicPackage>org.h2.*</publicPackage>
                </publicPackages>
            </configuration>
        </plugin>

Where the others look like this:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>nbm-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <moduleType>eager</moduleType>
                <codeNameBase>com.validation.manager.ui/1</codeNameBase>
            </configuration>
        </plugin>

As you can see, besides the module type and having public packages or not, there barely any differences.

The application works fine, is just something that has been puzzling me.

Any ideas?


Solution

  • check in your module's nbm file what cluster is defined in Info/Info.xml.

    • If it has wrong or missing value, you have to look in the module's pom configuration why it's so. Either it badly defined in the pom.xml or in the deprecated src/main/nbm/module.xml
    • The module might end up in "ide" cluster because you defined defaultCluster parameter in your application

    that's the behaviour for modules in the current nbm-maven-plugin. For osgi bundles the behaviour is more fluid as the bundle jars don't contain cluster information in the binary.