Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Ways to get the plugin version from a class name that belongs to it(I'm looking for a method to figure out the plugin version (the one we have on MANIFEST.MF) from a class name that belongs to this plugin)
icon3.gif  Ways to get the plugin version from a class name that belongs to it [message #871557] Mon, 14 May 2012 12:15 Go to next message
Raphael Moita is currently offline Raphael MoitaFriend
Messages: 25
Registered: September 2011
Junior Member
Buddies!

Does someone know how I could get the Bundle-Version value (MANIFEST.MF) from a class name that belongs to other required plugin?

I mean:

--------------
Plugin1 - version 1.0.0
class: com.abc.p1.Abc123
* does not have an Activator!
--------------
Plugin2 - requires Plugin1
class: com.abc.p2.Cdf456 uses Abc123 (on that point I need to get "Abc123" plugin's version)
--------------

Does osgi plataform offer some magic method to provide that information?


I'd appreciate any sugestion
Thanks
--
Raphael Moita
Re: Ways to get the plugin version from a class name that belongs to it [message #871563 is a reply to message #871557] Mon, 14 May 2012 12:25 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 501
Registered: July 2009
Senior Member
No Message Body
Re: Ways to get the plugin version from a class name that belongs to it [message #871564 is a reply to message #871563] Mon, 14 May 2012 12:26 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 501
Registered: July 2009
Senior Member
Version version = ((BundleReference) Abc123.class.getClassLoader()).getBundle().getVersion()

Hope that helps.

Tom.
Re: Ways to get the plugin version from a class name that belongs to it [message #871574 is a reply to message #871564] Mon, 14 May 2012 12:59 Go to previous message
Raphael Moita is currently offline Raphael MoitaFriend
Messages: 25
Registered: September 2011
Junior Member
Perfect! Much easier that I thought it would be! Smile

Thanks a million Tom
Previous Topic:Updating to 3.6.2 removes my branding
Next Topic:NoClassDefFoundError at plugin runtime
Goto Forum:
  


Current Time: Sat Oct 23 02:56:01 GMT 2021

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

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

Back to the top