如何检查 pom.xml 是否有更新的依赖项
我对 Maven 和 pom.xml 相当陌生。有没有办法可以找出哪些依赖项已过时,以便我可以更新 pom.xml 中的版本号。
例如,在其他语言中,Ruby 有命令 gem list outdated
,它为我提供了一个依赖项列表 (rubygems),我可以更新
我正在使用 IntelliJ Idea(如果这有帮助的话)。
I am fairly new to Maven and pom.xml. Is there a way I can find out which of my dependencies that are outdated, so that I can update version numbers in my pom.xml.
In other languages, for instance, Ruby has the command gem list outdated
that gives me a list of dependencies (rubygems) I can update
I am using IntelliJ Idea if that can help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 版本 Maven 插件 来完成此操作。检查以下目标:
versions:display-dependency -updates
扫描项目的依赖项并生成具有可用更新版本的依赖项的报告。版本:display-plugin-updates
扫描项目的插件并生成具有可用更新版本的插件的报告。以下是示例输出(取自示例):
Pom install
You can do this with the Versions Maven Plugin. Check the following goals:
versions:display-dependency-updates
scans a project's dependencies and produces a report of those dependencies which have newer versions available.versions:display-plugin-updates
scans a project's plugins and produces a report of those plugins which have newer versions available.Here is a sample output (taken from the examples):
Pom install
如果您想快速完成,可以使用 www.versioneye.com 网站。
您可以在那里定义您的项目并上传项目
pom.xml
,该网站还会定期向您发送电子邮件,通知您新的更新。您还可以提及您想要检查哪些库的更新。
我不知道它是否自动与maven repo 完全同步,但我总是发现它的lib 版本已更新。
更新:
6 年后该项目关闭了:(
所以
mvn versions:display-dependency-updates
似乎是选择。If you want to do it fast you can use www.versioneye.com site.
There you can define your project and upload project
pom.xml
, the site will also send you regular emails which notify you about new updates.You can also mention which libraries do you want to check for update.
I don't know if it automatically fully sync with maven repo or not, but I always find its lib versions are update.
Update:
After 6 years the project switched off :(
So the
mvn versions:display-dependency-updates
seems to be the choice.POM 依赖项对此的作用并不明显。
为了您的方便:
和存储库:
It isn't obvious what the POM dependency is for this.
For your convenience:
and the Repository:
IntelliJ IDE 有一个免费插件,可以检查 pom.xml 中定义的依赖项的新版本: Maven 依赖项检查器。
There's a free plugin for the IntelliJ IDE which checks for new versions of your dependencies defined in the pom.xml: Maven Dependency Checker.