dependency resolution strategy [message #505872] |
Tue, 05 January 2010 12:37 |
Eclipse User |
|
|
|
Originally posted by: pajai.extrabright.com
Hi all,
I am trying to understand how Buckminster does the dependency
resolution, in case where the same artifact in different version is a
transitive dependency of a base artifact (say an OSGi bundle).
Ex:
- Artifact A depends on B and C
- B depends on D version 1.5
- C depends on E
- E depnds on D version 1.6
Visually:
A - B
- D 1.5
- C
- E
- D 1.6
In such a case, maven would pick the artifact D which is closer to the
base artifact (in this case D 1.5), which is quite arbitrary.
After running some tests, it seems that Buckminster tries to pick both.
But I am not sure about that (which would lead to problems). Can someone
confirm which is Buckminster's strategy at choosing the right dependency?
Is there a way (for instance in a cspex of artifact A) to define which
version of D should be picked?
Thanks in advance.
Cheers,
Patrick
|
|
|
Re: dependency resolution strategy [message #506191 is a reply to message #505872] |
Wed, 06 January 2010 09:02 |
|
Hi Patrick,
Buckminster will always use version ranges and will make an attempt to intersect them to find a
common version that suits all requests. In the case of maven, such ranges are normally explicit so
there is no possible intersection. That in turn, means that both dependencies must be brought in.
You can override the selected version by using advisor nodes in the CQUERY. In your case you would
add a node with pattern that matches a request for D and specify that the range for all such
requests should be >= 1.6.
Regards,
Thomas Hallgren
Patrick J. wrote:
> Hi all,
>
> I am trying to understand how Buckminster does the dependency
> resolution, in case where the same artifact in different version is a
> transitive dependency of a base artifact (say an OSGi bundle).
>
> Ex:
> - Artifact A depends on B and C
> - B depends on D version 1.5
> - C depends on E
> - E depnds on D version 1.6
>
> Visually:
> A - B
> - D 1.5
> - C
> - E
> - D 1.6
>
> In such a case, maven would pick the artifact D which is closer to the
> base artifact (in this case D 1.5), which is quite arbitrary.
>
> After running some tests, it seems that Buckminster tries to pick both.
> But I am not sure about that (which would lead to problems). Can someone
> confirm which is Buckminster's strategy at choosing the right dependency?
>
> Is there a way (for instance in a cspex of artifact A) to define which
> version of D should be picked?
>
> Thanks in advance.
> Cheers,
>
> Patrick
|
|
|
Powered by
FUDForum. Page generated in 0.03986 seconds