-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include required plugins automatically seem not consider already added capabilties #1604
Comments
This is probably because eclipse.pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/DependencyManager.java Line 199 in 975f72b
And IIRC the slf4j.api bundle has a (OSGi) requirement to all it's providers through the Service-Loader mediator configuration. In this specific case the life-line that prevents a real problem is that the Aries SPI-fly service-loader mediator only considers bundles in state But of course in general it would be cleaner to not have the other providers in the product at all. I wanted to add meant to filter the considered required-wires so that the |
Should it not only require one? |
@HannesWell I have now further checked this and the spec mentions
where |
According to the javadoc
So something seems to be odd here... |
I was now able to debug it and it is as suspected in the initial description, PDE does only consider requirements on the bundle level (based on the wiring in the target state), in this case the requirement is fulfilled by two bundles:
|
Yes, after checking the required and provided capabilities in the MANIFEST.MF I also think that's what happens (sorry for not writing it earlier).
As you've already described later, that's what is already happening. For a flat class-path it's already possible to specify the factory explicitly. For OSGi runtimes the existing property could actually be re-used and the selection could iterate through available providers and test their class name. |
That is what I currently do, select one provider in the product configuration explicitly, the slf4j-simple is added additionally to what I already have selected :-) |
If I use the "Include required plugins automatically" option I noticed that it does seem to add more than required in some situations.
For example assume a product hat has
slf4j.api
and two slf4j provider implementations are in the target then PDE adds another slf4j provider even if one was already chosen in the product, I noticed that when working onwith the product here:
The product itself is "complete" so works with
autoIncludeRequirements="false"
already, no missing requirements are reported when validated. If one starts the product it is getting the expected message:Now I add
<plugin id="org.eclipse.equinox.slf4j"/>
and logging works and I get:if now one activates
autoIncludeRequirements="true"
one suddenly gets@HannesWell can you take a look as this feature is extremely useful but might confusing in some situations like this.
The text was updated successfully, but these errors were encountered: