A maven project consisting of some modules. One of my module is using guava dependency of google version 11.0.2
. Now i am integrating another module in my project which is also using guava but version 14
.
So i want that new module uses guava version 14
but remaining project use guava version 11.0.2
. I have tried adding <exclusion></exclusion>
of guava to the new module but it didn't work.
Any tips to solve this.
Update: @Guillaume Darmont's Answer solves the problem for different modules. but now my problem is, the new modules has 2 dependency one of the them is using guava 11.0.2
and other is using 14.0
. how to manage this. can we specify separately in the pom of the module that which version of the guava it should use.?
As I understand your question, you may add a <dependencyManagement>
for guava
in your new module pom.xml :
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>14.0.1</version>
</dependency>
</dependencies>
</dependencyManagement>
mvn dependency:tree
command will help to determine which module is bringing the Guava 14 jar file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With