In Eclipse plugin development: How to get current bundle version?
It is just in Manifest.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Nodeclipse
Bundle-SymbolicName: org.nodeclipse.ui;singleton:=true
Bundle-Version: 0.6.0.qualifier
Bundle-Activator: org.nodeclipse.ui.Activator
Require-Bundle: org.eclipse.ui,
However Java has method only to look at Bundle Implementation version
getClass().getPackage().getImplementationVersion();
In a more OSGi way, not having to know your name, and official standard way:
Version version = FrameworkUtil.getBundle(getClass()).getVersion();
Notice that the bundle version you get is from the bundle from which the this was loaded. So do not put this in a convenience library in another bundle!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With