springboot项目jar冲突问题解决
生活随笔
收集整理的這篇文章主要介紹了
springboot项目jar冲突问题解决
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
問題:大概意思就是項(xiàng)目中有兩個jar,同時是要是想slf4j的接口的,這樣程序不知道使用哪個,就會報錯了。也不算錯,項(xiàng)目照樣運(yùn)行。但是就是報日志錯誤
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,我們?nèi)?.pom文件中讓項(xiàng)目顯示jar依賴關(guān)系圖
然后找到了依賴,那么我們就選擇我們想要保留的 和 要刪除的進(jìn)行操作
我這里不需要logback 所以,我在logback
然后在pom文件中就會把這個jar拋出掉
然后就好了,大功告成。
總結(jié)
以上是生活随笔為你收集整理的springboot项目jar冲突问题解决的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: (经验总结)flowable工作流_01
- 下一篇: 注册docker hub账号