views:

119

answers:

1

Hi,

I have a feature and I want to change its' ID. However, this makes it impossible to update existing installation and here's why:

  1. Assume the feature F1 at version 1.0 consist of plugin A at version 1.0.
  2. Now, I want to have a feature F2 at version 1.1 which uses plugin A at version 1.1.
  3. Upon installing F2 I get an error - that I already have feature F1 which requires plugin A in version 1.0 and, thus, installing plugin A 1.1 will void that dependency.

I'm looking for a way to denote that F2 replaces F1. How can I do that?

A: 

I am assuming you are using p2.

When you export/build your feature with p2 metadata , the resulting content.xml (.jar) contains something like the following:

<unit id='f.feature.group' version='1.0.0' singleton='false'>
  <update id='f.feature.group' range='[0.0.0,1.0.0)' severity='0'/>
  ...
</unit>

This <update> element specifies previous versions of the feature that this one will update. The existing metadata generation tooling sets this as you see above.

I created a feature 'f' which includes plug-in "A 1.0.0" and exported with metadata and installed that feature into my eclipse. Then I created a feature 'g' which includes plug-in "A 2.0.0". I exported this again to the the same repository. Then I went and manually edited the content.xml file, and changed:

<unit id='g.feature.group' version='1.0.0.200907061120' singleton='false'>
  <update id='g.feature.group' range='[0.0.0,1.0.0.200907061120)' severity='0'/>

to

<unit id='g.feature.group' version='1.0.0.200907061120' singleton='false'>
  <update id='f.feature.group' range='[0.0.0,1.0.0.200907061120)' severity='0'/>

Then in my eclipse, I did a "Check for Updates", and it found 'g' as an update to the previous 'f' and did the upgrade. (You may need to force the repository to be reloaded to pick up the changes, doing a "test connection" in the Available Software Sites preference page should do this).

Unfortunately there is currently no way to do get the export/build process to change the update element for you, and it would need to be a manual edit. I raised this bug.

Andrew Niefer
Thanks. I will check that out and vote for the bug.
zvikico
Just for the record, I did try that and it doesn't work. Yet, I didn't find any documentation or other proof that this feature should exist, so opening a bug is a problem.
zvikico