Spring boot 无法解析SLF4J:类路径包含多个SLF4J绑定

Spring boot 无法解析SLF4J:类路径包含多个SLF4J绑定,spring-boot,log4j2,slf4j,Spring Boot,Log4j2,Slf4j,请参考下面我使用的pom.xml: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/Nick007/Desktop/sts-4.7.0.RELEASE/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/o

请参考下面我使用的pom.xml:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/Nick007/Desktop/sts-4.7.0.RELEASE/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/Users/Nick007/Desktop/sts-4.7.0.RELEASE/configuration/org.eclipse.osgi/5/0/.cp/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.SimpleLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/Nick007/Desktop/sts-4.7.0.RELEASE/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/Users/Nick007/Desktop/sts-4.7.0.RELEASE/configuration/org.eclipse.osgi/5/0/.cp/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.SimpleLoggerFactory]

4.0.0
org.springframework.boot
spring启动程序父级
2.3.1.1发布
com.startup
演示
0.0.2-快照
演示
SpringBoot的演示项目
2.6
1.8
org.springframework.boot
SpringBootStarterWeb
org.apache.logging.log4j
log4japi
org.apache.logging.log4j
log4j-to-slf4j
org.slf4j
七月至六月
org.springframework.boot
spring启动程序日志记录
org.springframework.boot
spring-boot-starter-log4j2
org.apache.logging.log4j
log4j-slf4j-impl
org.slf4j
slf4j api
org.springframework.boot
springbootmaven插件
无法解析SLF4J:类路径包含多个SLF4J绑定。 无法解析SLF4J:类路径包含多个SLF4J绑定。 无法解析SLF4J:类路径包含多个SLF4J绑定。 无法解析SLF4J:类路径包含多个SLF4J绑定。无法解析SLF4J:类路径包含多个SLF4J绑定。 无法解析SLF4J:类路径包含多个SLF4J绑定。 无法解析SLF4J:类路径包含多个SLF4J绑定。 无法解析SLF4J:类路径包含多个SLF4J绑定。 我尝试了多种方法,但仍然得到-类路径包含多个SLF4J绑定。
有人能帮我一下吗,我遗漏了什么?

您需要删除POM文件中依赖项中的冲突slf4j,我不太了解冲突的内容,但错误与冗余有关,因此您需要删除一些内容。当我遇到这样的错误时,我只是删除另一个依赖项

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.1.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.startup</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.2-SNAPSHOT</version>
    <name>demo</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <maven-jar-plugin.version>2.6</maven-jar-plugin.version>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-to-slf4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jul-to-slf4j</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.apache.logging.log4j</groupId>
                    <artifactId>log4j-slf4j-impl</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>