Skip to content

Publishing your Eclipse plug in

Risto Pohjonen edited this page Oct 2, 2015 · 4 revisions

These are instructions for exporting and publishing an Eclipse plug-in. They describe two ways of exporting a plug-in from existing source code and sharing it with Eclipse users.

  1. Exporting the plug-in as a single Jar-file and saving it to the Eclipse plugins folder.
  2. Packaging the plug-in(s) as an Eclipse Feature and publishing it on an Eclipse Update Site.

Exporting the plug-in as a JAR file

This is the simpler of these two options. It produces a single JAR file which can be shared with users. The plug-in is installed by copying it under the Eclipse\plugins folder and restarting Eclipse.

  • Choose the Eclipse project that contains the source code and Manifest from Package Explorer. Click the right mouse button and select “Export” from the pop-up menu.

  • Select “Deployable plug-ins and fragments” from the “Plug-in Development” folder and click “Next”.

  • Select the plug-ins you want to include and the location to save the JAR file on the disk. Click “Finish” and the plug-in is saved. Locate the JAR file, copy it to the Eclipse\plugins –folder, (re)start Eclipse with the (-clean) option and start using the plug-in.

  • Put the JAR file somewhere where other users are able to download and start using it.

Publishing the plug-in as a feature on an Eclipse Update Site

  • Select File | New | Project | Plug-in Development | Feature Project and click “Next”.

  • Give the feature a name, a version number and provider information, and click “Finish”.

  • From the plug-ins tab click “Add” and start typing the plug-in name in the text field. The plug-in should appear in the list. Select the plug-in and click “OK”. If you have many plug-ins, include them all in the list.

Next, create an Eclipse Update Site project.

  • Select File | New | Project | Plug-in Development | Update Site Project and click “Next”. Give a name for the Project and click “Finish”.

  • Add a new feature category to the Update Site. This category is shown to the user when the update site content is loaded in the Eclipse plug-in installation wizard. To add a feature, select Add Feature and select the created feature from the list. When the feature is included, click “Build All” to build the plug-ins into one feature.

When you have a plug-in, feature and update site project you may want to provide an update to a feature that you have published before. Starting from the plug-in, increase the version number in the plug-in manifest file. Next, open feature.xml file from the feature project and increase the version number. This is shown to the user when the new update is installed through the wizard. Finally, open the site.xml file located in the Update Site project. On the Site Map, open the category in the tree and select one of the existing features under that category. Click “Add Feature”, select the new feature with the updated version number and click “Build All” to build the feature. Don't worry that your new feature is shown differently from the old ones, which are grayed out and named features/*.

The update site project needs to be uploaded to the Internet so that people can download it to their own Eclipse. Place the content of the Update site project on the server. Put the site.xml in the root folder of the URL path. Placing the updated project in the same location as the previous version will allow users to see this as an update to the existing plug-in. For example, the Graph Browser update site project is located at:

https://bintray.com/metacase/metaedit-plugin-for-eclipse/GraphBrowser

and contains the following files and folders:

  • features/
    • com.metacase.graphborwser.feature_0.1.6.jar
    • com.metacase.graphborwser.feature_0.1.7.jar
    • com.metacase.graphborwser.feature_1.0.0.jar
    • com.metacase.graphborwser.feature_1.0.1.jar
    • com.metacase.graphborwser.feature_1.0.3.jar
    • com.metacase.graphborwser.feature_1.0.4.jar
    • com.metacase.graphborwser.feature_1.0.5.jar
    • com.metacase.graphborwser.feature_1.0.6.jar
  • plugins/
    • com.metacase.graphbrowser _0.1.6.jar
    • com.metacase.graphbrowser _0.1.7.jar
    • com.metacase.graphbrowser _1.0.0.jar
    • com.metacase.graphbrowser _1.0.1.jar
    • com.metacase.graphbrowser _1.0.3.jar
    • com.metacase.graphbrowser _1.0.4.jar
    • com.metacase.graphbrowser _1.0.5.jar
    • com.metacase.graphbrowser _1.0.6.jar
  • artifacts.jar
  • content.jar
  • site.xml

Clone this wiki locally