Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Installable Unit Version - feature of plugin?
Installable Unit Version - feature of plugin? [message #1004556] Wed, 23 January 2013 12:58 Go to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Hi Guys
I am creating an auto-update-on-startup mechanism in my e4 application, and to me it's not clear how the versioning mechanism works in equinox.

1) WHAT is exactly the version of an installable unit? Is it the version of the feature or the version of the plugin in the feature? I tried debugging equinox code, turns out InstallableUnit.setVersion is used by InstallableUnitDescription.setVersion, which has no reference anywhere. When / by what does the version of the IU get set?

2) is it absolutely necessary to have features in order to use p2?

Quoting Lars Vogel's simple tutorial:
"The update and installation of functionalities with p2 is based on Features projects. In the terminology of p2 these features are installable Units"
That means IU version = feature version
But according to equinox wiki:
"As the name implies,IUs describe things that can be installed, updated or uninstalled. They do not contain the actual artifacts but rather essential information about such artifacts (e.g., names, ids, version numbers, dependencies, etc) and are not aware about what they deliver. They describe things. They are NOT the things. So for example an IU for a bundle is NOT the bundle. The bundle is an "artifact". "
Now that's pretty abstract and confusing.

Thanks a lot for your answer


Laura
Re: Installable Unit Version - feature of plugin? [message #1004635 is a reply to message #1004556] Wed, 23 January 2013 15:21 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hi Laura

I am currently working on the same feature for our e4ap application. I just got a simple update of an installed plugin working Smile.

To your questions: Afaik both the feature and the plugin are installable units and both have a version number.

I tried to get p2 working with just a product definition but failed. The reason for this was (at least thats how I came to understand it), that a product always "includes" the plugins, where a feature can just "depend" on plugins or other features. The second construct is necessary for updates, otherwise I always get "unsatisfied dependency" errors. Please correct me if I am wrong!

I found these blogs to be helpful:
http://aniefer.blogspot.de/2009/07/adt-part-2-more-like-epp.html
http://aniefer.blogspot.de/2009/07/composing-and-updating-custom-eclipse.html

My next task will be to also discover new plugins and to deinstall plugins that are no longer needed. I suspect that the construct of a feature (used as a container for plugins) will be a good way to discover changes like this.

I'd be very thankfull if you would share any insights on the subject Smile

Smile
Christoph
Re: Installable Unit Version - feature of plugin? [message #1004666 is a reply to message #1004635] Wed, 23 January 2013 16:20 Go to previous messageGo to next message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Dear Christoph
thanks for your answer.
We also managed to have a working auto updating dummy e4 project today.
But it took definitely too much time for something which actually should be standardized.
WHY the features are necessary are not clear to me. I just know, I tried without and I got as well dependency exceptions.
For our project, we just need to update plugins, not to install new features or remove them. This will be done through releasing.

About versioning: I just found an article where I read that when we update a plugin, we need to update also:
- its version in its manifest
- the feature version
- the product version

If you have qualifiers it obviously happens automatically.
But what is good is: if the feature contains for example 10 plugins, only the one with the changed version number will be updated.

So my insights are not particularly useful Smile but this is my experience...
Thanks

Laura
Re: Installable Unit Version - feature of plugin? [message #1004679 is a reply to message #1004666] Wed, 23 January 2013 16:44 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hi Laura,

thanks for your insights! Are you using UpdateOperation? If yes, are you doing anything special in your build to get it to work?

Why I'm asking: In my case UpdateOperation will never update anything because UpdateOperation.getInstalledIUs() always returns an emtpy collection. Looking at the code, there is a property "org.eclipse.equinox.p2.type.root" which is used in the query to find the installed root IU. Apperantly, this property is not set in my profile.

I managed to get it to work using the lowlevel P2 API, but I would still like to understand ...

Thanks!
Christoph
Re: Installable Unit Version - feature of plugin? [message #1004687 is a reply to message #1004679] Wed, 23 January 2013 17:05 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hi Laura

ignore my last post ... now I do have a root IU. Mysterious ... Wink

Smile
Christoph
Re: Installable Unit Version - feature of plugin? [message #1004956 is a reply to message #1004687] Thu, 24 January 2013 07:57 Go to previous message
Laura V is currently offline Laura VFriend
Messages: 32
Registered: March 2012
Member
Yes I'm using UpdateOperation to avoid writing p2ql queries manually.
Happy coding!
Laura
Previous Topic:How to include Java SE classes when starting up from the command line?
Next Topic:javax.annotation package
Goto Forum:
  


Current Time: Thu Mar 28 12:42:09 GMT 2024

Powered by FUDForum. Page generated in 0.73785 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top