Eclipse has a very easy to use and extensible version system. When I send someone a patch or want to test my code on another machine I usually go through the entire exercise of creating an Eclipse update site and installing the features like a normal user would. With Lotus Notes 8.5.1 and above I actually create a Widget to install the features and plugins because that is how the end user will do it. Well, at some point you know all of that works and you may just want to get a new binary out without going through the widget install and restart method. This method, which I am about to walk you through, assumes you will launch with the “-clean” option to clear any cache in the product (Notes, Sametime, etc), so you can just copy the new plug-in jar file over the existing one. So you would shut down the product, export the plug-in, and relaunch the product with “-clean”. For instance, I launch Lotus Notes on my development machine with the following options:
C:notesframeworkrcprcplauncher.exe -console -clean -config notes -vmargs -Duser.language=en -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8020
That not only sets up my Notes to accept patches but it also gives me the error console and the ability to attach to it with a debugger on port 8020.
The key is to make sure you match the version of the file exactly – otherwise Eclipse will get all confused. The version is usually in the plug-in name like “com.acme.plugin_188.8.131.52010122134“. When you compile an update site, if your plug-in and features have their versions set to use “.qualifier” the date and time are inserted where .qualifier is specified. In the case of our plug-in the version looks like this:
I use the export method in the Eclipse PDE. I export the plug-in using the right click on the project name and select “Export”, I then choose the “Deployable plug-ins and fragments” option:
The key is on the next couple of tabs. You select the place you want to place the jar file and then on the next tab you can tell the export process the exact date and time to use:
This will now overwrite the existing jar file (which will have the same name) with the newly compiled jar file containing the changes. You can even export this file directly to an Eclipse update site and replace a plugin without generating a whole new update site.
Two references are key to understanding how versions work with plug-ins and features. You should check out these two articles on the Eclipse wiki and SDK help: