Spring Tool Suite执行mvn clean install出现SLF4J多绑定问题如何解决
问题现象
执行mvn clean install命令时,控制台输出如下告警信息:
SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/Applications/SpringToolSuite4.app/Contents/Eclipse/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:/Applications/SpringToolSuite4.app/Contents/Eclipse/configuration/org.eclipse.osgi/1965/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:/Applications/SpringToolSuite4.app/Contents/Eclipse/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:/Applications/SpringToolSuite4.app/Contents/Eclipse/configuration/org.eclipse.osgi/1965/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的日志绑定实现,SLF4J会自动选定其中一份作为实际日志输出的实现,不会直接导致构建失败。本次告警的两份绑定均来自SpringToolSuite4内置的m2e Maven插件运行时,不属于项目自身的依赖冲突。
处理方案
- 若不需要清除控制台告警,可直接忽略该输出,
mvn clean install的构建结果不受影响 - 若需要消除告警,可调整STS的Maven运行配置:
- 打开STS偏好设置,依次进入
Maven > Installations配置页 - 取消勾选「使用内置Maven运行时」,替换为本地独立安装的Maven路径
- 重启STS后重新执行构建命令即可
- 打开STS偏好设置,依次进入
内容的提问来源于stack exchange,提问作者vijayan007
相关产品推荐
相关产品推荐

