简体   繁体   English

我如何修复Eclipse项目,其中在项目下以及“ Maven Dependencies”文件夹下都列出了Maven依赖项?

[英]How do I fix Eclipse project where maven dependencies are listed right under project but also under 'Maven Dependencies' folder?

I have this weird problem. 我有这个奇怪的问题。 It was working fine, but lately after some developers joined the project, all of a sudden Maven dependencies are listed both under Maven Dependencies folder as well as under the project. 一切正常,但是最近一些开发人员加入该项目后,突然在Maven Dependencies文件夹和项目下都列出了Maven依赖项。 Please see pic. 请看图片。 I've highlighted a sample dependency that's listed twice. 我已突出显示了两次列出的示例依赖项。

在此处输入图片说明

So far, it seems like the project compiles fine, etc etc. But it just annoys me to see that. 到目前为止,该项目似乎编译正常,依此类推。但这让我很烦。 Any ideas how to fix it? 任何想法如何解决?

Thank you. 谢谢。

This might happen when people insert external dependencies manually in the build path as follows: 当人们按如下方式在构建路径中手动插入外部依赖项时,可能会发生这种情况:

Select Project > Right Click > Properties > Java Build Path > Add External JARs... 选择项目>右键单击>属性> Java构建路径>添加外部JAR ...

You can get rid of unwanted external libraries by removing them from the top level list ( don't remove JRE System Library and Maven Dependencies ). 您可以通过从顶级列表中删除不需要的外部库来摆脱它们( 不要删除 JRE System LibraryMaven Dependencies )。 As these libraries are managed by Maven you don't need to include them into the project manually. 由于这些库由Maven管理,因此您无需手动将它们包含在项目中。

And the reason why you're seeing configuration changes of other developers is that when Eclipse .settings , .classpath and .project files are checked into the Repository. 看到其他开发人员的配置发生变化的原因是,当Eclipse .settings.classpath.project文件被检入存储库时。 (Remove these entries from the repository if you have authorization to do so and you'll have a clean repository.) (如果您有权这样做,请从存储库中删除这些条目,并且您将获得一个干净的存储库。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM