解决jar包依赖冲突:Found Banned Dependency

使用eclipse的maven构建项目的时候出现了依赖冲突

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building zdttb-core 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ zdttb-core ---
[INFO] Deleting D:\workspace-asiabao\zdttb-core\target
[INFO] 
[INFO] --- debug-plugin:1.0-SNAPSHOT:clean-local (default) @ zdttb-core ---
[INFO] ${clean.local.disabled}为true,跳过clean-local Mojo。
[INFO] 
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-banned-dependencies) @ zdttb-core ---
[WARNING] Rule 2: org.apache.maven.plugins.enforcer.BannedDependencies failed with message:
Found Banned Dependency: commons-logging:commons-logging:jar:1.2
Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.875 s
[INFO] Finished at: 2019-03-26T10:18:56+08:00
[INFO] Final Memory: 21M/220M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce-banned-dependencies) on project zdttb-core: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 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

--------------------- 

各种mvn clean, update项目都不好使,最主要的是前两天还正常使用,突然就好不使了

根据错误提示,首先找到该项目的目录:

进行命令:

mvn dependency:tree 查看项目依赖树:

根据项目中的提示

Found Banned Dependency: commons-logging:commons-logging:jar:1.2

查找到

是在这个包下 org.jxls:jxls-poi:jar:1.0.11

或者根据命令查找: mvn dependency:tree -Dverbose -Dincludes=“xxx”

找到以后,在项目中去除该包,再重新mvn clean install

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值