Do not install optional p2 dependencies of requirements [message #1824366] |
Tue, 14 April 2020 08:54  |
Eclipse User |
|
|
|
Hello!
We use Oomph in our company to install Eclipse-based products
In our products we want to use EGit plug-ins, so our product Oomph setup has EGit feature as requirement in Setup P2Task
But don't want JDT or JDT UI to be installed
EGit UI has optional dependency to "org.eclipse.jdt.ui"
How can i mark our EGit requirement to force p2 to skip EGit optional depencencies?
Tried set "greedy" to "false" but that doesnt work. As i read later, "greedy" means to provide ability for requirement to be installed from other sources, and that is not that i want
|
|
|
Re: Do not install optional p2 dependencies of requirements [message #1824413 is a reply to message #1824366] |
Wed, 15 April 2020 00:22   |
Eclipse User |
|
|
|
Let me first explain what "optional" and "greedy" means.
An installable unit X declares an optional requirement on a capability Y if X provides extra functionality that becomes active if (and only if) some other installed unit Z provides the capability Y. The important point is that X can still be installed even if no other installed unit provides capability Y.
By default an optional requirement is non-greedy, which means that an installation of X does not automatically "pull in" any Z just because it provides a Y. If (at the same time or later) another installable unit Z1 is installed that provides Y the extra functionality of X becomes automatically active. If an optional requirement of X is declared to be greedy the installation of X will try to pull in a Z that provides Y, i.e., it will try to not leave the installation of Z to other IUs.
In fact org.eclipse.egit.ui declares the following
<required namespace='osgi.bundle' name='org.eclipse.jdt.core' range='[3.12.0,4.0.0)' optional='true' greedy='false'/>
<required namespace='osgi.bundle' name='org.eclipse.jdt.ui' range='[3.12.0,4.0.0)' optional='true' greedy='false'/>
Both requirements are non-greedy. That means, if org.eclipse.jdt.(core|ui) get installed, then not because of the requirement of org.eclipse.egit.ui but because of the non-optional or optional-greedy requirement of a third IU.
You have to find out what this third IU is and through what requirements it is pulled in from your root requirements. There's nothing in Oomph (or p2 for that matter) that let's you modify the requirement declarations of arbitrary IUs. If all "offending" requirements are optional-greedy, i.e., not non-optional, you may have a chance to specify a "negative" root requirement on org.eclipse.jdt. Newest Oomph versions allow to declare the cardinality of a requirement in terms of min/max. If you set max to zero the requirement becomes negative. To see the min/max attributes in the Properties view you must enable the "Show Advanced Properties" button.
|
|
|
|
Re: Do not install optional p2 dependencies of requirements [message #1824480 is a reply to message #1824465] |
Wed, 15 April 2020 23:22  |
Eclipse User |
|
|
|
Peter N wrote on Wed, 15 April 2020 20:03How do you think is it expected behaviour?
Sorry, I don't get what you're asking.
Peter N wrote on Wed, 15 April 2020 20:03May i somehow mark org.eclipse.xtext.common.types.ui dependency of org.eclipse.xtext.builder as non-greedy ? May be somehow in "feature.xml"?
As I already said, I know of no way for you to do this. Only the provider of org.eclipse.xtext.builder can do it.
|
|
|
Powered by
FUDForum. Page generated in 0.03722 seconds