TaT ConfigClustersAndModules

Configure Clusters and Modules

Contributed by; Varun Nischal


Brief Overview
Assuming the concerned project is opened, so Right-click the Project Node in Logical View, and select Properties. Now, on the left of the Wizard, you select Libraries, and on the right, you see related options to configure Java Platform, NetBeans Platform, as well as Platform Modules which are inclusive of Clusters and Modules.
Clusters and Modules
Generally, you would uncheck those clusters which you don’t want your application to be dependent on, that also means your application would build faster.

Also, changes get reflected in your App’s platform.properties file. So, if you want to avoid using GUI for removing a cluster, not specific modules within that cluster, and tweak it directly in the file.

Continue reading...

Tricks


Daily builds for NetBeans 6.5 have NetBeans Platform with following clusters-

apisupport1, gsf1, harness, ide10, java2, nb6.5,
platform9, profiler3, websvccommon1

By default, your application’s platform.properties file stored under nbproject and displayed as NetBeans Platform Config in Logical View, has contents..

nbplatform.active=default

That’s the only property you have. Now, suppose I want to remove gsf1 cluster from the above list, add the following property-

enabled.clusters=\
    apisupport,\
    harness,\
    ide,\
    java,\
    nb,\
    platform,\
    profiler,\
    websvccommon

So, as you can see the properties file doesn’t show version of the clusters (ordered alphabetically always), so its version independent as well. This is what you see when you remove gsf1 cluster using Project Properties Wizard, and rest are meant to be enabled by the Application you are using.

Now, if I want to restore gsf1, and remove websvccommon1, then you need to just tweak it as follows-

enabled.clusters=\
    apisupport,\
    gsf,\
    harness,\
    ide,\
    java,\
    nb,\
    platform,\
    profiler

If you remove some specific modules from a particular cluster, then following properties are added into the properties file-

disabled.modules=\
    {codename.base.of.modules}
enabled.clusters=\
    apisupport,\
    gsf,\
    harness,\
    ide,\
    java,\
    nb,\
    platform,\
    profiler,\
    websvccommon

Here you would see that when I disable (Please use GUI Wizard to disable) some modules from (suppose) java2 cluster, their Code Name Base would be added into the disabled.modules property. Also, you are required to add enabled.clusters property, with all clusters included.

Tips to Remember


This is also applicable to Module Suite project template, and you would see same files, where you can tweak as shown above. If you remove the property-

enabled.clusters=
  • Then, you would see your application/suite using all the clusters bundled with NetBeans Platform.
  • Suppose, when you disable a module A of cluster B, always add the enabled.clusters property as well and also, include the cluster B.
disabled.modules=\
    A
enabled.clusters=\
    B,\
    C,\
    D
  • If you disable the cluster, all the modules within the cluster automatically gets disabled. Not, vice-versa :)
  • Also, I recommend you to use GUI Wizard to disable specific modules, whether you’re an expert/not. Reason being that you might not know what dependencies the other modules have on this module A.
Someone has rightly said, “Prevention is better than cure”

However, if you want to enable some of the modules disabled using Wizard, then of course you may use the tweaks shown above to do the trick.

Hope this helps..

Acknowledgements


Someone asked on the OpenIDE mailing list,
"I wonder what is the absolute minimum of modules needed to start developing an app on the platform and after that adding my own modules."
Tom Wheeler ( NetBeans Dream Team Member)
He gave an excellent reply, and in his detailed answer, I found something that I thought of sharing with you, so as to help you tweak your NetBeans Platform Application and Module Suite.



Adapted from Blog Entry- http://nbguru.wordpress.com/2008/10/19/tat-configure-clusters-and-modules-11/

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo