栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

【问题】maven中设置不引入子依赖

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【问题】maven中设置不引入子依赖

问题

在编译某些开源项目时,会提示如下内容:

Require upper bound dependencies error for io.airlift:aircompressor:0.15 paths to dependency are:
+-io.hetu.core:presto-vv:1.3.0
  +-io.hetu.core:presto-main:1.3.0
    +-io.airlift:aircompressor:0.15 (managed) <-- io.airlift:aircompressor:0.16
and
+-io.hetu.core:presto-vv:1.3.0
  +-org.apache.pulsar:managed-ledger:2.8.0
    +-org.apache.pulsar:pulsar-common:2.8.0
      +-io.airlift:aircompressor:0.15 (managed) <-- io.airlift:aircompressor:0.16
and
+-io.hetu.core:presto-vv:1.3.0
  +-io.hetu.core:presto-main:1.3.0
    +-io.hetu.core:hetu-transport:1.3.0
      +-io.airlift:aircompressor:0.15 (managed) <-- io.airlift:aircompressor:0.16
and
+-io.hetu.core:presto-vv:1.3.0
  +-io.hetu.core:presto-tests:1.3.0
    +-io.hetu.core:presto-main:1.3.0
      +-io.airlift:aircompressor:0.15 (managed) <-- io.airlift:aircompressor:0.16
,
Require upper bound dependencies error for com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.4 paths to dependency are:
+-io.hetu.core:presto-vv:1.3.0
  +-org.apache.pulsar:managed-ledger:2.8.0
    +-org.apache.pulsar:pulsar-common:2.8.0
      +-com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.4 (managed) <-- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.3
]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.581 s
[INFO] Finished at: 2021-09-15T14:53:10+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (default) on project presto-vv: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Hel
p 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

原因及解决方法

这种一般是开启了依赖检查,检查时发现引入的多个依赖中都包含相同的子依赖,而且版本不一致。

所以可以通过设置在某些依赖中排除相同依赖的方法进行解决,如下示例中在kafka依赖中排除log4j等依赖:


    org.apache.kafka
    kafka_2.10
    ${dep.kafka.version}
    
        
            log4j
            log4j
        
        
            org.slf4j
            slf4j-log4j12
        
        
            zookeeper
            org.apache.zookeeper
        
        
            netty
            io.netty
        
        
            org.scala-lang
            scala-library
        
    

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/292830.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号