mavendependenciesversionconvergence

How to resolve dependency convergence error in jasperreports with commons-logging library?


Environment:

Maven dependency:

...
<dependency>
   <groupId>net.sf.jasperreports</groupId>
   <artifactId>jasperreports</artifactId>
   <version>${jasperReport.version}</version>
   <exclusions>
       <exclusion>
           <groupId>org.olap4j</groupId>
           <artifactId>olap4j</artifactId>
       </exclusion>
       <exclusion>
           <groupId>xml-apis</groupId>
           <artifactId>xml-apis</artifactId>
       </exclusion>
       <exclusion>
           <groupId>stax</groupId>
           <artifactId>stax-api</artifactId>
       </exclusion>
       <exclusion>
           <groupId>com.lowagie</groupId>
           <artifactId>itext</artifactId>
       </exclusion>
   </exclusions>
</dependency>
...

Dependency convergence error for commons-logging:commons-logging:1.2 paths to dependency are:
+-es.caib.accfor:accfor-commons:8.0.0
  +-net.sf.jasperreports:jasperreports:6.5.1
    +-commons-beanutils:commons-beanutils:1.9.4.redhat-00002
      +-commons-logging:commons-logging:1.2
and
+-es.caib.accfor:accfor-commons:8.0.0
  +-net.sf.jasperreports:jasperreports:6.5.1
    +-commons-digester:commons-digester:2.1
      +-commons-logging:commons-logging:1.1.1
and
+-es.caib.accfor:accfor-commons:8.0.0
  +-net.sf.jasperreports:jasperreports:6.5.1
    +-commons-logging:commons-logging:1.1.1
and
+-es.caib.accfor:accfor-commons:8.0.0
  +-net.sf.jasperreports:jasperreports:6.5.1
    +-org.codehaus.castor:castor-xml:1.3.3
      +-org.codehaus.castor:castor-core:1.3.3
        +-commons-logging:commons-logging:1.1.1
and
+-es.caib.accfor:accfor-commons:8.0.0
  +-net.sf.jasperreports:jasperreports:6.5.1
    +-org.codehaus.castor:castor-xml:1.3.3
      +-commons-logging:commons-logging:1.1.1

[WARNING] Rule 3: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability. See above detailed error message.

Solution

  • You need to choose one of the versions, probably 1.2 and add an entry to your <dependencyManagement>.