如何使用commons-logging库解决jasperreports中的依赖项收敛错误?

问题描述

环境:

  • JBoss7.2
  • Java 11

Maven依赖项:

...
<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.

解决方法

您需要选择一个版本,可能是1.2,然后在<dependencyManagement>中添加一个条目。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...