Java 在项目中找不到StaticLoggerBinder

Java 在项目中找不到StaticLoggerBinder,java,log4j2,Java,Log4j2,我有一些模块的项目。在parent中,我定义了: org.apache.logging.log4j log4j-slf4j-impl ${version.log4j} 运行时 但当我要部署应用程序时,找不到StaticLoggerBinder: No org.slf4j.impl.StaticLoggerBinder found in ClassPath, trying with log4j... 但是当我在这个项目中加入依赖性时 <dependency> <gr

我有一些模块的项目。在parent中,我定义了:

org.apache.logging.log4j log4j-slf4j-impl ${version.log4j} 运行时

但当我要部署应用程序时,找不到StaticLoggerBinder:

No org.slf4j.impl.StaticLoggerBinder found in ClassPath, trying with log4j...
但是当我在这个项目中加入依赖性时

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
<version>${version.log4j}</version>
</dependency>

正如您所看到的,第二个来自我的父项目。我真的很困惑为什么会这样。有人能告诉我应该如何修复它吗?

您也有log4j核心和log4j api依赖项吗

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hudect/.m2/repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hudect/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.0-rc1/log4j-slf4j-impl-2.0-rc1.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 [org.slf4j.impl.Log4jLoggerFactory]