And to add a small thing about Justing just said:
Maven determines which version to use looking at the "closeness".

So, if you want a particular version, the best way is to specify it in the
wanted artefact (say in the war, for you).

Btw, mvn dependency:list will also show you what is finally select as
dependencies.

Cheers.

2008/12/12 Edelson, Justin <justin.edel...@mtvstaff.com>

> This may or may not be the expected behavior. But first, just to be clear,
> the fact that the war and jar are in the same multi-module project is
> irrelevant. All that matters is the ordering of dependencies and the
> 'closeness' of various dependencies.
>
> In your example, the two projectX dependencies have the same closeness
> (they are dependencies of dependencies). So the order in the pom is the
> determining factor.
>
> Try running mvn -Dverbose=true dependency:tree
>
> Justin
>
> ----- Original Message -----
> From: Spam Trap <junk-...@nc.rr.com>
> To: users@maven.apache.org <users@maven.apache.org>
> Sent: Thu Dec 11 18:33:59 2008
> Subject: Unexpected version packaged in war
>
> So, I have a multi-module maven project consisting of a war project
> and a jar project.  The jar is a dependency of the war. I'm seeing
> some unexpected behavior around which dependencies get bundled up in
> WEB-INF/lib.  Namely, it seems like dependencies from the war
> project, either direct or transitive, are trumping dependencies of
> the jar (again, direct or transitive), regardless of version.  For
> example, my jar project depends on projectX-2.0.  The war depends on
> Y-1.1 which has a transitive dependency on projectX-1.0.  When the
> war gets built projectX-1.0 is what winds up in WEB-INF/lib.  I know
> I can work around this using <excluded> in the war; I'm more curious
> as to why this is happening.  Is it a bug or intended behavior.  If
> it's intended, what's the rationale?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Reply via email to