I am working with Maven project and I have two projects, ProjectA
and ProjectB
. My ProjectA
is a maven library whose pom looks like th
There may be incompatible differences between the version of a library that a dependency requires and the one you want to use. If you are happy to take this risk, you can use maven exclusions
to ignore transitive dependencies.
You can exclude, for example, spring-core
from being brought in by PartialKernel
by adding:
<dependency>
<groupId>com.texture.partial.core</groupId>
<artifactId>PartialKernel</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
</exclusions>
</dependency>
Note that you will have to do this for every dependency that brings in spring dependencies.
Now define the version of spring-core
you want to use in the top level pom dependency management section:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
</dependencies>
</dependencyManagement>