You need to enable JavaScript to run this app. Spring Tool Suite执行mvn clean install出现SLF4J多绑定问题如何解决
优惠活动
大模型
产品
解决方案
定价
更多

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运行配置:
    1. 打开STS偏好设置,依次进入 Maven > Installations 配置页
    2. 取消勾选「使用内置Maven运行时」,替换为本地独立安装的Maven路径
    3. 重启STS后重新执行构建命令即可

内容的提问来源于stack exchange,提问作者vijayan007

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.30 21:15:08