> because there are times when two versions of jars are there in lib which
> causes problems while deployed war runs on server. Also I have seen

I saw your follow up post and wanted to let you know one common way
that two versions of jars end up in your war's lib directory...

Suppose an artifact "xyz" was using groupId "abc" until version 2.0.4,
and then switched over to "com.abc" for version 2.0.5 and above. Some
dependencies might pull in abc:xyz:2.0.1 while others pull in
com.abc:xyz:2.0.5. Maven does not realize those are different versions
of the "same" artifact, so the usual dependency resolution process
does not work as it should.

The only way to deal with this is to analyze your dependency tree and
prune the unwanted artifacts, which is just what you said you are
doing.

Another common way this happens is when you run "mvn package"
repeatedly, and change versions of dependencies etc but then never run
"mvn clean" so your /target folder is full of older build dependencies
that are no longer being used. You should run "mvn clean" periodically
to clean things up, or even better, use a continuous integration
server (Hudson etc) that ensures your builds are clean every time they
are performed.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to