天天看点

IDEA 报错 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath 排除依赖冲突,已解决!

IDEA 报错 LoggerFactory is not a Logback LoggerContext but Logback is on the classpath,如何排除依赖冲突?

解决:

  1. 修改zkclient的依赖,加入exclusion
  2. 修改spring-boot-starter-web依赖,加入exclusion
<dependency>
            <groupId>com.101tec</groupId>
            <artifactId>zkclient</artifactId>
            <version>0.10</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
		</dependency>
           
<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>
           

继续阅读