Search code examples
eclipseeclipse-plugineclipse-rcpmanifest.mf

What is product ID in Eclipse plugin?


It is said here, that product Id should be set "as defined in your plugin manifest".

What does it mean? That product Id should coincide with plugin Id? But this can't be true, since product can contain many plugins.

How to specify product in plugin manifest?

UPDATE

When editing product file with Eclipse editor, I have 2 places to define product

enter image description here

In upper field I can apparently enter anything I want. Lower field apparently refers the "product" extension of some plugin, allowing of creating new one by button.

What is the relation between these two places?


Solution

  • In your plugin you define the product using the org.eclipse.core.runtime.products extension point - something like:

    <extension
         id="product"
         point="org.eclipse.core.runtime.products">
      <product
            name="%product.name"
            application="org.eclipse.e4.ui.workbench.swt.E4Application">
      .. more ...
    

    The product id is then the plugin id plus the value of the id attribute, so something like pluginid.product. This is what you specify in the product configuration. The product configuration editor should show you this id in the list of available products.

    Update: I have not seen a good explanation of what the ID field in the product file is for, possibly something to do with the p2 installation code. I have seen discussions that say it can cause errors if it matches other ids. Using a unique id works.