自动更新Maven依赖项 [英] Update Maven dependencies automatically

查看:143
本文介绍了自动更新Maven依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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.xmls 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:

版本:显示依赖关系更新显示所有与之相关的依赖关系 有较新的版本.

versions:display-dependency-updates Displays all dependencies that have newer versions available.

这将显示所有已更新依赖项的列表.有一个类似的命令来显示所有已更新插件的列表.

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依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆