5/16/2008

Copy plugins between NetBeans installations

NetBeans installer does not migrate plugins, and with every new installation, your old plugins are gone. This makes sense because the new NetBeans installation may not support the old plugins. So you will need to re-install these plugins through update centers or manually installing downloaded *.nbm files.

Another option is to copy the plugin jar and configuration files, from the old .netbeans directory to the new .netbeans directory. For example, this is how I copied whichelement plugin from NetBeans 6.0 to 6.1:
cd $HOME/.netbeans/6.0/modules
cp org-netbeans-modules-whichelement.jar $HOME/.netbeans/6.1/modules/

cd $HOME/.netbeans/6.0/config/Modules/
cp org-netbeans-modules-whichelement.xml $HOME/.netbeans/6.1/config/Modules/
Restart NetBeans and you will see the new plugin is enabled. These copied plugins will always appear installed in Tools | Plugins window, and grayed out. So there is no way to deactivate or uninstall them, since they were not installed with the wizard in the first place. But I guess you can always configure them by editing their config files under .netbeans/6.1/config/Modules. The following is the config file for whichelement (org-netbeans-modules-whichelement.xml):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//NetBeans//DTD Module Status 1.0//EN"
"http://www.netbeans.org/dtds/module-status-1_0.dtd">
<module name="org.netbeans.modules.whichelement">
<param name="autoload">false</param>
<param name="eager">false</param>
<param name="enabled">true</param>
<param name="jar">modules/org-netbeans-modules-whichelement.jar</param>
<param name="reloadable">false</param>
<param name="specversion">1.5</param>
</module>
This is not the recommended approach in most cases and may not work for some plugins. However, it can be useful if you can't find it in update centers or in *.nbm form.

Update on 12/07/2008:
I've copied whichelement plugin from my NetBeans 6.1 installation to 6.5. It works fine so far.