XML Tools Plugin in NetBeans Plugin Portal

I wrote about the XML Schema Editor a while ago (here) and how you can install it in NetBeans IDE 7.x (i.e., any 7, e.g., 7, 7.0.1, 7.1). And then there were questions about simplifying the process, i.e., putting all those NBM files into the NetBeans Plugin Portal.

So, a few days ago I did that. (But then forgot I had done so since it was at the height of my jetlag in San Francisco where I was doing things at 2 AM and then forgetting I'd done them.)


Go to the above page and click the Download button. You'll then have one single module, instead of the dozen or so that you'd normally get, i.e., the XML Tools plugin consists of many individual modules. I have a trick whereby I put all the JARs and related metadata into a single NBM, which is much more convenient for distribution than distributing all the individual NBMs.

You too can do the same thing, if you want to bundle the content of multiple NBMs into a single NBM. It is hacky, be warned, but it works. Create a new NetBeans module in NetBeans IDE. Build the module. Switch to the Files window. Go to "build/cluster". Create a new folder/subfolder there "update/download", i.e., you'll have "build/cluster/update/download". Then put all the NBMs (i.e., in my case, all the modules from the XML Tools plugin) into the "download" folder and then run the module, i.e., right-click the module in the Projects window and run it. Now NetBeans IDE starts up and all the NBMs are 'exploded', i.e., unpacked and their content is put into the correct places within the module's build folder. Then copy all the JARs, from where they've been unpacked, into "build/cluster/module" folder and all the XML files into the "build/cluster/config/Modules" folder. Then create a ZIP file, i.e., externally, on disk, of the content of the "cluster" folder (but excluding the cluster folder itself, i.e., you'll have the folders "config", "modules", and "update_tracking" on the highest level of the ZIP). Then change the extension of the ZIP to NBM. And now you have a new NBM file constructed from the cluster of your build folder, containing all the JARs from the NBMs you included, as well as the related XML files providing the related metadata. When you install that single NBM file, everything else you included, i.e., the JARs, are installed too, since you also have the metadata needed for installing them.


I would very strongly discourage anyone from trying what is described above. What was uploaded is not a well-formed NBM (nor is it like the output of the steps described above, which would not work either), and it is unlikely to work correctly with Plugin Manager, especially when updates are needed, or when things need to be turned on or off.

Anyone who downloaded this already, I would suggest discarding your user directory since future updates will be broken; and Geertjan you should remove this malformed NBM from downloads ASAP.

Anyway such hacks are unnecessary, since the Plugin Portal already lets you upload a ZIP of regular *.nbm files in one step. These are then presented in the normal way in Plugin Manager when you enable the PP update center: those modules marked AutoUpdate-Show-In-Client=true are displayed as plugins, and their transitive dependencies are considered.

Posted by Jesse Glick on October 12, 2011 at 06:10 AM PDT #

Really? So the Plugin Manager works directly with ZIP files? Did not know that.

Posted by Geertjan on October 12, 2011 at 07:13 AM PDT #

Hm. I removed the NBM, put the ZIP file up there, downloaded the ZIP file, but couldn't install it. Based on what you wrote above, I would have expected to be able to install the ZIP. But, as I had assumed previously, that's not supported. So you need to unzip the ZIP and install those modules separately, which is what I was trying to avoid.

Posted by Geertjan on October 12, 2011 at 07:20 AM PDT #

Plugin Manager does not work with ZIP files. The Plugin Portal accepts a ZIP of NBMs, and offers them correctly when accessed via the Portal's update center. (If you manually download the ZIP then you need to unpack it before installing them, but you should not be manually downloading anything from PP because you can just add its UC instead.)

Posted by Jesse Glick on October 12, 2011 at 08:12 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« April 2014