SLF4J: Class path contains multiple SLF4J bindings.

错误信息:

1
SLF4J Warning: Class Path Contains Multiple SLF4J Bindings

错误原因:
我个人博客系统一个爬虫组件用到webmagic,而webmagic与lomback中的slf有冲突。

解决办法(webmagic排除相关依赖即可):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!-- webmagic-->
<dependency>
<groupId>us.codecraft</groupId>
<artifactId>webmagic-core</artifactId>
<version>${webmagic.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>

参考解决问题地址:
SLF4J Warning: Class Path Contains Multiple SLF4J Bindings

文章目录