问题:使用idea创建Maven工程,进行单元测试时,出现SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.错误。
解决:在pom.xml中添加依赖,因为在测试环境下所以scope标签中为test,运行在main下的可以将test改一下。
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
<scope>test</scope>
</dependency>