问题描述
我在Eclipse中有大量的Maven项目,并且有很多依赖项.
I have a significant number of Maven projects in Eclipse, with quite a lot of dependencies.
随着新版本的发布,某些依赖项经常在存储库中更新.目前,我必须手动查找这些内容,并手动编辑相应的pom.xml
以使用新版本.
Some of the dependencies are frequently being updated in repositories as new versions are released. Currently I have to look out for these manually, and manually edit the respective pom.xml
s to use the new version.
在Eclipse中是否可以自动执行以下操作:
Is there an automatic way to do the following in Eclipse:
- 检查每个依赖项的更新版本是否可用?
- 如果是,是否会自动建议对
pom.xml
进行更改(例如快速修复"功能)?
- Check whether newer versions of each dependency are available?
- If so, automatically suggest changes to the
pom.xml
(like a "quick fix" feature)?
推荐答案
您正在寻找maven 版本插件:
You are looking for maven versions plugin:
这将显示所有已更新依赖项的列表.有一个类似的命令来显示所有已更新插件的列表.
This will show a list of all updated dependencies. There is a similar command to show a list of all the updated plugins.
似乎没有命令可以自动将依赖项更新到最新版本.从文档看来,如果在pom文件中将依赖版本指定为属性,则可以使用versions:display-property-updates
来更新依赖版本.
There doesn't seem to be a command to update the dependencies to their latest versions automatically. From the docs it looks like you can use the versions:display-property-updates
to update the dependency versions if they are specified as properties in the pom file.
这篇关于自动更新Maven依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!