【发布时间】:2018-12-10 01:18:48
【问题描述】:
我在尝试进行 MAVEN 安装时遇到此错误。我尝试了排除,但不确定在 pom 文件中包含的位置。让我如何以及应该在我的 pom 文件中包含哪些排除标签。我还附上了我的 pom 文件 sn-p where to include the excludes`SLF4J: Class path contains multiple SLF4J bindings.
SLF4J:发现绑定在 [jar:file:/C:/Users/147188/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder .class]
SLF4J:发现绑定在 [jar:file:/C:/Users/147188/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.10.0/log4j-slf4j-impl-2.10.0.jar!/org /slf4j/impl/StaticLoggerBinder.class]
SLF4J:请参阅http://www.slf4j.org/codes.html#multiple_bindings 解释。 SLF4J:实际绑定是类型 [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
POM 文件:
<!-- Start of required part to make log4j work -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- End of required part to make log4j work -->
【问题讨论】:
-
你解决了吗?
标签: maven log4j maven-2 classpath slf4j