首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Eclipse Maven: SLF4J: Class path包含多个SLF4J绑定

Eclipse Maven: SLF4J: Class path包含多个SLF4J绑定
EN

Stack Overflow用户
提问于 2020-08-21 15:27:24
回答 6查看 6.8K关注 0票数 9

当我试图以Maven构建的身份运行时,我得到了这个错误。有没有人可以帮我解决绑定冲突,谢谢。

代码语言:javascript
复制
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Applications/Eclipse.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/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/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/Eclipse.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/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/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]
EN

回答 6

Stack Overflow用户

发布于 2021-03-03 01:57:10

这不是eclipse中的bug。我们只需要从"Maven integration for eclipse“中卸载slf4j,这是一个已经安装在eclipse上的附加软件。你可以在eclipse market place看到这一点。

执行以下步骤:

  1. 在eclipse中,转到help ->,单击Market place ->,单击installed。在这里,您将看到已经安装的eclipse的Maven集成。

  1. 现在单击更改按钮。在那里,您将看到slf4j over logback被选中。取消选中它,然后单击确认按钮。这将从"Maven integration for eclipse“软件中卸载slf4j。

现在,在进行maven构建时,您可以检查slf4j绑定错误是否已经消失。享受吧!

票数 14
EN

Stack Overflow用户

发布于 2020-09-28 20:05:59

这是Eclipse中的一个已知错误。一种解决方法是,单独安装Maven (不使用嵌入Eclipse的Maven二进制文件)。

然后,您可以在以下位置选择外部Maven二进制文件:Window->Preferences->Maven->Installations

它应该看起来像这样:

我在这里使用的是Windows,但在Linux中是相同的过程。从包管理器安装maven (例如sudo apt Install maven),然后在Eclipse中激活它。

附言:在您的系统上安装了Maven之后,命令mvn dependency:tree也会起作用。

票数 6
EN

Stack Overflow用户

发布于 2020-09-24 23:17:32

这似乎是Eclipse 2020-09之前版本中的一个bug。我也得到了这个。

请参阅https://bugs.eclipse.org/bugs/show_bug.cgi?id=506676

据我所知,到目前为止还没有解决办法。使用项目的Maven依赖项不会解决问题,因为它是由m2e插件和eclipse引起的,所以它超出了项目的范围,它在集成开发环境中。:-(

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63518376

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档