0
点赞
收藏
分享

微信扫一扫

springboot项目jar冲突问题解决


问题:大概意思就是项目中有两个jar,同时是要是想slf4j的接口的,这样程序不知道使用哪个,就会报错了。也不算错,项目照样运行。但是就是报日志错误
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/renjianjun/software/mavenLocalRespository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/renjianjun/software/mavenLocalRespository/org/slf4j/slf4j-simple/1.7.25/slf4j-simple-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

解决方式:

我们需要先找到哪里使用了这些jar,我们去 .pom文件中让项目显示jar依赖关系图

springboot项目jar冲突问题解决_jar冲突


然后找到了依赖,那么我们就选择我们想要保留的 和 要删除的进行操作我这里不需要logback 所以,我在logback

springboot项目jar冲突问题解决_jar_02


然后在pom文件中就会把这个jar抛出掉

springboot项目jar冲突问题解决_jar_03


然后就好了,大功告成。


举报

相关推荐

0 条评论