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依賴關系圖

然后找到了依賴,那么我們就選擇我們想要保留的 和 要刪除的進行操作

我這里不需要logback  所以,我在logback

然后在pom文件中就會把這個jar拋出掉

然后就好了,大功告成。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM