« My vote for best architecture of the 20th century | Main | Ant 1.6.2 is out »

Creating a local Eclipse Update site

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"?>
<site>
</site>

Create two directories underneath this one called plugins and @features.

h2.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:

<?xml version="1.0" encoding="UTF-8"?>
<feature id="com.bea.eclipse.weblogic" label="Weblogic Plugin"
version="1.1.1" provider-name="BEA Systems">
<description>
This is a plugin to control a local Weblogic instance from
within Eclipse.
</description>

<license>
None mentioned
</license>

<url>
<update label="My Update Site" url="http://[server]eclipse-updates/"/>
</url>

<plugin id="com.bea.eclipse.weblogic" download-size="0"
install-size="0" version="1.1.1"/>
</feature>

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:

<?xml version="1.0" encoding="UTF-8"?>
<site>
<description url="http:///eclipse-updates">
My Eclipse Update Server
</description>
<feature url="features/com.bea.eclipse.weblogic_1.1.1.jar" id="com.bea.eclipse.weblogic" version="1.1.1" >
<category name="App Server" />
</feature>
<category-def name="App Server" label="Application Server">
<description>Tools to control Application Servers</description>
</category-def>
<site>

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).

Comments (3)

Tim Cummings:

Hi Robert,

Your html is broken at http://twasink.net/blog/archives/2004/07/creating_a_loca.html

You have a reference to which should be <server>

Otherwise it is a very informative page.

colin:

This page doesn't display in full in firefox, but switching to IE meant I could view it all

Gaurav Kapoor:

Pretty informative site. The site helped me create and deploy an update site. However, when I release the next version of the plugin, the Update manager does not pick it up (I have made 2 entries in site.xml and have the resources for both the versions). Any idea what might cause this problem?

Post a comment


About

This page contains a single entry from the blog posted on July 16, 2004 11:17 AM.

The previous post in this blog was My vote for best architecture of the 20th century.

The next post in this blog is Ant 1.6.2 is out.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.35