You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by fr...@tolina.de on 2011/09/05 14:24:59 UTC

Dependency resolution problem

Hello,

we are currently migrating from Ant to Maven and are encountering some 
dependency resolution issues.

According to the documentation Maven resolves by 
nearest-to-root-algorithm, so given a project structure like

P -> A (1.1.0) -> B (1.5.0)
P -> B (1.3.0)

meaning P depends on A in version 1.1 etc. would resolve A (1.1) and B 
(1.3). 

Our semantics for compatibility assumes different major numbers as 
generally incompatible, which should result in a build failure. All 
different minor numbers are treatet as generally backwards compatible.

A project setup like
 
P -> A (1.1.0) -> B (2.1.0)
P -> B (1.3.0)

should cause a build failure, a setup like

P -> A (1.1.0) -> B (1.5.0)
P -> B (1.3.0)

should not, but we have to guarantee, that B (1.5.0) is resolved, not B 
(1.3.0), which is not the standard maven dependency resolution.

Has anyone an idea how to solve this?

Regards

Frank Jakop

Re: Dependency resolution problem

Posted by Wayne Fay <wa...@gmail.com>.
> P -> A (1.1.0) -> B (2.1.0)
> P -> B (1.3.0)
>
> should cause a build failure, a setup like
>
> P -> A (1.1.0) -> B (1.5.0)
> P -> B (1.3.0)
>
> should not, but we have to guarantee, that B (1.5.0) is resolved, not B
> (1.3.0), which is not the standard maven dependency resolution.

Locking down versions of dependencies with [x.y] should get you at
least some of the way there. You should also be using pluginManagement
and dependencyManagement to specify versions of things in one place
(in the parent P) to avoid some of this in the first place. The
versions plugin may also be something that you should look at.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org