Wendy,

Thanks for the reply. Responses below:

Wendy Smoak wrote:

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

But I still have a question here -- I noticed that in the exclusion,
there's no "version" element allowed. I happened to benefit here from
the fact that ehcache had actually been moved to net.sf.ehcache, so I
used that as the dependency groupId. But I don't quite understand this
-- what I am trying to exclude is not ehcache, but a particular version
of it. Why isn't a version supported for the exclusion?


You don't need a version number on an exclusion because you're always
trying to get rid of the entire thing.  If you just want a different
version, you simply declare a dependency on the version you want, and
Maven will choose the 'nearest' definition.

The detail I've posted prior in this thread shows at least one case where it appears that Maven doesn't do this. The fact that Maven wasn't choosing the proper version, or for that matter, any version (it was including them both), and the groupId's and and artifactId's were identical between my pom.xml and the dependency pom, shows that this doesn't seem to work in all cases. This not working properly is the reason for my original question.


In this case, you *are* trying to completely exclude ehcache:ehcache
(groupId and artifactId).  As far as Maven is concerned,
ehcache:ehcache and net.sf.ehcache:ehcache are completely separate
dependencies.

This was only doable this way because ehcache:ehcache had just happened to be moved to net.sf.echcache:ehcache. Had this not been the case, this wouldn't have worked -- I would have had to try to include echcache:ehcache version 1.2 and exclude version 1.1. In fact, this is the original problem, which raised the question of how to explicitly exclude one version of a dependency while explicitly including another version of a dependency.

I guess the thing that's a bit unnerving is that although we've found a workaround, the original problem still exists. Why doesn't Maven properly filter out the earlier version of the dependency?

Brad

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

Reply via email to