No. You must exclude the versions you don't want.
This can be tricky to do, since dependencies quickly multiply. You could
have just one direct dependency and up with MANY inherited dependencies.
I have used a technique where I comment-out all the dependencies and add
them back in to the project one-by-one while I keep a close eye on what
dependencies I am inheriting. As a method to (relatively) quickly see
all the dependencies, you can run 'mvn eclipse:eclipse' after you add
each dependency and Refresh the project in Eclipse to see an updated
list of all the dependencies. The order is somewhat random in Eclipse,
however, which can makes the list difficult to scan. A directory listing
of the WEB-INF/lib directory might be a better method if you have a
webapp. So anyway, as you uncomment the dependencies one-by-one, you
will know where an inherited dependency came from if you want to exclude it.
You can also look at the pom.xml files for your direct dependencies to
see a list of their dependencies.
I was just thinking about this issue in general today, as I updated a
project to use spring 2 one-big-jar and exclude spring 1
lots-of-partial-jars from some other dependencies. A GUI tool that
helped with dependency management by interactively showing inherited
dependencies and where they came from would be really useful. You could
quickly setup the dependencies you want, and then dump out the
corresponding pom.xml code.
-Max
Satish wrote:
is there any way to specificy which version to take precedence in the
classpath, looks like i have some other dependency jars which want the older
version. I want the latest version to take precedence.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]