我收到以下错误。似乎有多个日志框架绑定(bind)到 slf4j。不知道如何解决这个问题。非常感谢任何帮助。
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/admin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/admin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
最佳答案
通过在导致冲突的依赖项(pom.xml)中添加以下排除项来解决。
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
关于maven-2 - SLF4J:类路径包含多个 SLF4J 绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57002011/