After having to work out how to do this again, I thought I’d give a step-by-step guide to creating an Eclipse Update site populated by existing plugins. For this example, I’ll create an update site for the Weblogic Eclipse plugin
Create the update site
If you’ve already got one of these, skip this step. Otherwise, you’ll need to create a directory on a webserver somewhere. This is referred to afterwards as $update-dir.
In this is directory, you’ll need to create a file called ‘site.xml’. Because you don’t have any thing there yet, this is pretty empty:
<?xml version=”1.0″ encoding=”UTF-8″?>
Create two directories underneath this one called plugins and @features.
Install the plugin locally
Download the plugin and install it locally, by copying it to $ECLIPSE_HOME/plugins; the plugin is called com.bea.eclipse.weblogic_1.1.1
After this step, quickly start Eclipse and make sure the plugin is working. If it’s not, pack up and go home. 🙂
Transform the plugin
Eclipse Update sites can’t take plugin directories, unfortunately. So we need to package the plugin into a JAR. It is important to make sure you preserve the Manifest information. The command I used was:
jar cvMf com.bea.eclipse.weblogic_1.1.1.jar -C com.bea.eclipse.weblogic_1.1.1
Copy the jar file to $update-dir/plugins
Create a feature definition.
Odds are the plugin hasn’t come with a feature definition, so you need to make one of those. It’s not hard, however.
In $update-dir/features, create a directory with the same name as the plugin, e.g. com.bea.eclipse.weblogic_1.1.1. Then create a file called feature.xml in this new directory. The contents of the file look like this:
This is a plugin to control a local Weblogic instance from within Eclipse. None mentioned
Back out to the $update-dir/features directory and turn the directory you just made into a JAR. e.g.
bc. jar cvf com.bea.eclipse.weblogic_1.1.1.jar -C com.bea.eclipse.weblogic_1.1.1
After this you can delete the directory if you want.
Update the site.xml file.
You now need to publish the new feature by updating the site.xml file. The new file looks like this:
<description url="http:///eclipse-updates"> My Eclipse Update Server Tools to control Application Servers
And that’s it. All you need to do now is point your Eclipse installation at the update site and download the feature (though you probably want to delete the locally installed plugin first).