I am working with spring and using mvn site to check my test coverage and app dependency convergence, I am getting [Error] Error You do not have 100% convergence.
Dependencies used in modules
org.slf4j:slf4j-api
1.7.25
com.epam.brest.course:rest-producer:war:1.0-SNAPSHOT
\- com.jayway.jsonpath:json-path:jar:2.3.0:test
\- (org.slf4j:slf4j-api:jar:1.7.25:test - omitted for conflict with 1.7.5)
1.7.5
com.epam.brest.course:rest-producer:war:1.0-SNAPSHOT
\- net.sf.dozer:dozer:jar:5.5.1:compile
+- org.slf4j:slf4j-api:jar:1.7.5:compile
\- org.slf4j:jcl-over-slf4j:jar:1.7.5:compile
\- (org.slf4j:slf4j-api:jar:1.7.5:compile - omitted for duplicate)
I it says the issue is with versions of my slf4g in module rest-producer but i cant see any issue with my versions in this module , here it is below.
rest-producer
<dependency>
<groupId>com.epam.brest.course</groupId>
<artifactId>service</artifactId>
</dependency>
<dependency>
<groupId>net.sf.dozer</groupId>
<artifactId>dozer-spring</artifactId>
</dependency>
<dependency>
<groupId>net.sf.dozer</groupId>
<artifactId>dozer</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.epam.brest.course</groupId>
<artifactId>utility</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
and my parent module has such versions
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<h2.version>1.4.196</h2.version>
<spring.version>4.3.14.RELEASE</spring.version>
<log4j2.version>2.10.0</log4j2.version>
<thymeleaf-spring4.version>3.0.8.RELEASE</thymeleaf-spring4.version>
<project.version>1.0-SNAPSHOT</project.version>
<servlet.version>3.0.1</servlet.version>
<jackson.databind-version>2.9.4</jackson.databind-version>
<validation.version>1.1.0.Final</validation.version>
<hamcrest.version>1.3</hamcrest.version>
<jsonpath.version>2.3.0</jsonpath.version>
<junit.version>4.12</junit.version>
<hibernate.version>5.1.3.Final</hibernate.version>
<dozer.version>5.5.1</dozer.version>
<Mocktio.version>1.9.5</Mocktio.version>
</properties>
Can i get some suggestion of what it might be , the project has about 9 modules
The is jsonPath which i am using has a dependency
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<scope>compile</scope>
</dependency>
And dozer which i am also using has
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
And versions are different I think this is the proble but what can i do exclude one of them or change version of their dependency
I think the error you are getting is due to having two versions of the same artifact in your dependencies. Try to exclude slf4j-api
from the json-path
dependency, to force your project to depend only on version 1.7.5
:
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
You could also do the same exclusion on the dozer
dependency. However, I feel it's safer to do it here, since this is dependency is only used for tests.