On 7/2/06, Brad O'Hearne <[EMAIL PROTECTED]> wrote:

I have a project which is dependent on a resource we'll call "X". X is
dependent on a resource called "Y", so in my pom, I am only specifying
the direct dependency on X. My project builds a WAR, and when packaged,
X and Y are included. Everything's fine so far. But it turns out, for
various reasons, I actually need a newer version of Y, than the one that
X is specifying. If I specify the newer version of Y in my pom.xml file,
when packaged, both versions of Y are included -- not what I want.

It sounds like Maven doesn't think the two versions of Y are really
the same dependency.  Do the groupId and artifactId match exactly?

So if
I specify both versions of Y in my pom.xml file, and list the scope of
the older version as "provided" and the scope of the newer one as
"compile", neither one is included.

This doesn't really fit with the behavior you described earlier, but
if you look at the output of mvn -X you'll probably find that the
'provided' scope overrides compile.

I would:
1. declare a dependency on the correct version of Y
2. add an exclusion to the X dependency, excluding its transitive
dependency on Y

--
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to