Which maven dependency prevails when I declare two different versions in
the same pom file?
This is a real example I stumbled upon. I am having spring-context
artifact with the following declaration (spring.version is 3.2.4.RELEASE):
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
If you check this page
http://www.mvnrepository.com/artifact/org.springframework/spring-context/3.2.4.RELEASE
you will see in the paragraph (This artifact depends on ...) all the
dependencies that are imported when you use the declaration above. One of
them is hibernate-validator(4.3.0.FINAL).
Later on , I decide to use another version of hibernate-validator in my
pom.xml file (for example because its is newer) and I declare the
following code :
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.1.Final</version>
</dependency>
Now it seems that my project is importing two different versions of
hibernate-validator. Which one is being used by the project? Thank you.
No comments:
Post a Comment