Usually what you would do is look first at the dependency tree and see where the same jars are coming from:
mvn dependency:tree
After you tracked down where the different dependencies come from you, as in your case, you pick the ones that are older and you go ahead and add a <exclusion/>
tag inside the dependency that retrieves the older ones.
Example of how to exclude a dependency inside another dependency:
Let us presume you have hibernate
and ehcache
dependencies in your pom.xml
. If hibernate
3.2.6.ga
, for example, has inside ehcache
, but it is an older version and we don't want that version. So in order to exclude ehcache
from hibernate
dependency we would do the following
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.6.ga</version>
<exclusions>
<exclusion>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</exclusion>
</exclusions>
</dependency>
Now, I would help you and add the correct exclusions to the dependencies that are retrieving your older dependencies, but since I am not able to see your pom.xml
it is hard to help more.