How to find out which feature contains a needed plug-in on an Eclipse download site

If you fire up the p2 console, you can use the p2 query language to find all features that depend on a bundle. My example is in Eclipse Juno (4.2):

  1. switch to the OSGi console in the console view
  2. ss p2.console # to find the console bundle number
  3. felix:start -t consoleBundleNumber

Now you can issue p2 queries. To find which features in your current install contain org.eclipse.jface, you can use:

osgi> provlpquery this "select(parent | parent.properties['org.eclipse.equinox.p2.type.group'] == true && parent.requirements.exists(rc | everything.exists(iu | iu.id == 'org.eclipse.jface' && iu ~= rc)))" true
org.eclipse.e4.rcp.feature.group 1.1.0.v20120521-2329-8yFTIGF3GGduEYqkQB9M3DKn
org.eclipse.e4.tools.css.spy.feature.feature.group 0.12.0.v20111206-1509-17B-7w3123161302752

To find out which feature includes org.eclipse.ui.views.properties.tabbed you can use:

osgi> provlquery http://download.eclipse.org/releases/juno "select(parent | parent.properties['org.eclipse.equinox.p2.type.group'] == true && parent.requirements.exists(rc | everything.exists(iu | iu.id == 'org.eclipse.ui.views.properties.tabbed' && iu ~= rc)))" true
org.eclipse.amp.amf.feature.group 0.9.0.v20120528-0244
org.eclipse.bpel.feature.feature.group 1.0.1.v20120606-0845-CI
org.eclipse.jwt.feature.feature.group 1.2.0.v201205310546-7O7i-FK_Qj4QkVn3kW9q
org.eclipse.platform.feature.group 4.2.0.v20120528-1648-9JF7BHV8FyMteji0MoOeOuU6sAnxIeYtKNM1dK
org.eclipse.ptp.etfw.tau.feature.group 6.0.0.201206052145
org.eclipse.tcf.te.feature.feature.group 1.0.0.201206051725
org.eclipse.tcf.te.tcf.feature.feature.group 1.0.0.201206051725

In this case, org.eclipse.platform.feature.group is the most correct one.

The first example is querying profiles in the running eclipse, so it uses provlpquery this. The second example is specifying an external p2 repository, so it uses provlquery repo.

See http://wiki.eclipse.org/Equinox_p2_Console_Users_Guide for more information on the p2 console. There’s a lot of black magic going on 🙂

Leave a Comment