Java Maven 更新项目在 Eclipse 中做什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20546962/
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
What does Maven Update Project do in Eclipse?
提问by Ashish
What does "Maven -> Update Project..." do in Eclipse?
“ Maven -> 更新项目...”在 Eclipse 中有什么作用?
采纳答案by Gimby
It syncs the Eclipse project settings with that of the pom. If you for example change important plugin settings, such as the output java version, you will find that Eclipse will ask you to update the project and afterwards the configured Java runtime in the project will have changed to reflect what your Maven pom indicates.
它将 Eclipse 项目设置与 pom 的设置同步。例如,如果您更改重要的插件设置,例如输出 java 版本,您会发现 Eclipse 会要求您更新项目,然后项目中配置的 Java 运行时将发生更改以反映您的 Maven pom 指示的内容。
That is an important thing to keep in mind: the Maven pom is the lead in this kind of project setup. If you want settings to change, try to do that through the pom and not through Eclipse project settings directly or doing a project update might revert what you have changed. There are usually some things I have to correct myself anyway though, such as build path exclusions that m2eclipse likes to put in and strange deployment assembly configurations.
记住这一点很重要:Maven pom 是这种项目设置的领导者。如果您希望更改设置,请尝试通过 pom 而不是直接通过 Eclipse 项目设置来执行此操作,否则执行项目更新可能会还原您所做的更改。尽管如此,通常还是有一些事情我必须自己纠正,例如 m2eclipse 喜欢放入的构建路径排除和奇怪的部署程序集配置。
回答by ddavison
To add on to what @Gimby said - Update Project also provides more options such as Force Update of Snapshots / Releases
which is extremely helpful when you have dependencies that are looking for the latest. (e.g.: [1.0)
will find 1.0.* - whatever's the latest.)
补充@Gimby所说的 - 更新项目还提供了更多选项,例如Force Update of Snapshots / Releases
当您有正在寻找最新版本的依赖项时,这非常有用。(例如:[1.0)
会找到 1.0.* - 无论是最新的。)
Updating project is synonymous with Ivy's Resolve. It will make sure that all referenced dependencies are there, as well as clean the project to make sure that they are included correctly.
更新项目是 Ivy's Resolve 的代名词。它将确保所有引用的依赖项都在那里,并清理项目以确保它们被正确包含。
回答by Witold Kaczurba
I could not dig out the documentaiton, but I was able to dig out the code. To complement @Gimby answer - you can go into details and look into what the function does in here:
我无法挖掘出文档,但我能够挖掘出代码。为了补充@Gimby 的回答 - 您可以详细了解该函数在此处的作用:
Look for : updateProjectConfiguration0 function.
寻找:updateProjectConfiguration0 函数。
Cheers,
干杯,