Java 你如何从eclipse刷新maven依赖?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/136308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 08:43:35  来源:igfitidea点击:

How do you refresh maven dependencies from eclipse?

javaeclipsemaven-2

提问by ScArcher2

We recently started using maven for dependency management. Our team uses eclipse as it's IDE. Is there an easy way to get eclipse to refresh the maven dependencies without running mvn eclipse:eclipse?

我们最近开始使用 maven 进行依赖管理。我们的团队使用 Eclipse 作为 IDE。有没有一种简单的方法可以让 eclipse 在不运行 mvn eclipse:eclipse 的情况下刷新 maven 依赖项?

The dependencies are up to date in the local maven repository, but eclipse doesn't pick up the changes until we use the eclipse:eclipse command. This regenerates a lot of eclipse configuration files.

依赖项在本地 maven 存储库中是最新的,但 eclipse 不会在我们使用 eclipse:eclipse 命令之前获取更改。这会重新生成很多 eclipse 配置文件。

采纳答案by Joe

Have you tried using the m2eclipseplugin? I use it with eclipse and it maintains the eclipse .classpath when I add dependencies. It'll also check for updated dependencies.

您是否尝试过使用m2eclipse插件?我将它与 eclipse 一起使用,当我添加依赖项时,它会维护 eclipse .classpath。它还会检查更新的依赖项。

回答by Chris Vest

You generate the special eclipse files with mvn eclipse:eclipse, but once you've done that, you should let a pluginhandle the dependencies while inside eclipse.

您使用 生成特殊的 eclipse 文件mvn eclipse:eclipse,但是一旦完成,您应该让插件在 eclipse 中处理依赖项。

That's how we do it at my work place, and it generally works well.

我们在我的工作场所就是这样做的,而且通常效果很好。