eclipse-equinox / p2

Eclipse Public License 2.0
14 stars 40 forks source link

P2 is not supporting the effective directive properly #473

Open laeubi opened 6 months ago

laeubi commented 6 months ago

See this comment here:

https://github.com/eclipse-equinox/p2/blob/57ecc5a05ba4420f4983be2c27832fe139ab5d09/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java#L392

Currently P2 generates for example when using this manifest headers:

Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.compo
 nent)(version>=1.3.0)(!(version>=2.0.0)))",osgi.service;filter:="(obj
 ectClass=org.bndtools.headless.build.manager.api.HeadlessBuildPlugin)
 ";effective:=active;cardinality:=multiple,osgi.ee;filter:="(&(osgi.ee
 =JavaSE)(version=17))"

the following requirement: <requiredProperties namespace='osgi.service' match='(objectClass=org.bndtools.headless.build.manager.api.HeadlessBuildPlugin)' min='0'/>

this has some drawbacks so one can't choose for the effectiveness in a P2 resolve operation should apply or not.

I therefore would suggest that we transform this into something like filter="(osgi.effective.active=true)" so one can choose in the resolve context if such a requirement is to be considered or not.

chaitanyavalli-r commented 2 months ago

Do we have a fix for this? or any workaround to apply? We are also having the same constraint and the maven builds are failing. Please advise.

laeubi commented 2 months ago

I fear now one has worked on this until now, so the only option is to provide that dependency.