Maven Update Project在Eclipse中做了什么?

时间:2023-01-24 23:07:19

What does "Maven -> Update Project..." do in Eclipse?

Eclipse中的“Maven - > Update Project ...”做了什么?

Maven Update Project在Eclipse中做了什么?

3 个解决方案

#1


77  

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喜欢放置的构建路径排除和奇怪的部署程序集配置。

#2


16  

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所说的内容 - 更新项目还提供了更多选项,例如强制更新快照/版本,这在您拥有寻找最新版本的依赖项时非常有用。 (例如:[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的Resolve同义。它将确保所有引用的依赖项都存在,并清理项目以确保它们被正确包含。

#3


0  

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的答案 - 您可以详细了解该函数的功能:

https://github.com/eclipse/m2e-core/blob/41f5ae34ad2543ef1439b7fd7e0a03b596af8685/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java#L365

https://github.com/eclipse/m2e-core/blob/41f5ae34ad2543ef1439b7fd7e0a03b596af8685/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java#L365

Look for : updateProjectConfiguration0 function.

查找:updateProjectConfiguration0函数。

Cheers,

干杯,

#1


77  

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喜欢放置的构建路径排除和奇怪的部署程序集配置。

#2


16  

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所说的内容 - 更新项目还提供了更多选项,例如强制更新快照/版本,这在您拥有寻找最新版本的依赖项时非常有用。 (例如:[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的Resolve同义。它将确保所有引用的依赖项都存在,并清理项目以确保它们被正确包含。

#3


0  

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的答案 - 您可以详细了解该函数的功能:

https://github.com/eclipse/m2e-core/blob/41f5ae34ad2543ef1439b7fd7e0a03b596af8685/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java#L365

https://github.com/eclipse/m2e-core/blob/41f5ae34ad2543ef1439b7fd7e0a03b596af8685/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java#L365

Look for : updateProjectConfiguration0 function.

查找:updateProjectConfiguration0函数。

Cheers,

干杯,