maven-2 - SLF4J:类路径包含多个 SLF4J 绑定(bind)

标签 maven-2 slf4j

我收到以下错误。似乎有多个日志框架绑定(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/

相关文章:

maven-2 - 是否可以拆分 maven pom 文件?

java - 可以同时运行maven1和maven2吗?

maven-2 - Maven : Multiple class with the same path implemented in different jar

maven-2 - Maven:在 war:exploded 之前清理 webapp 目录?

maven-2 - 如何使用 Maven 将 GWT 模块打包为 Jar 文件?

java - 无法从 dropwizard 项目中排除 logback-classic 依赖项

java - 线程 "main"java.lang.NoClassDefFoundError : org/slf4j/LoggerFactory 中的 Gradle 异常

java - 如何使用 SLF4J 和 Log4j 在日志消息中包含标记

java - 不使用slf4j就不能使用log4j吗?

mysql - 连接到 MySQL 数据库时,Hibernate 工具在 Eclipse STS 中出错