In one module, I use spring-boot-starter-activemq:2.07.RELEASE
which depends on activemq-broker:5.15.8
which depends on guava:18.0
.
In another module, I would like to use guava, so I have to use:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
If I use an higher version in my pom.xml
this version will be also used by activemq-broker
due to the nearest definition rule of the dependency mediation (see Introduction to the Dependency Mechanism)
I don't want to provide a different version of Guava than what is asked by activemq-broker
. So in order to synchronize the versions, each time there is a Spring Boot upgrade, I need to check manually the versions in order to synchronize them.
I use activemq-broker
and guava
as an example but my question is more general: How to automatically reuse a dependency version from one module into another?