小编典典

Maven 检查存储库中更新的依赖项

all

是否有 Maven 插件可让您检查存储库中是否有更新版本的依赖项可用?

假设您使用的是 1.2 版本的依赖项 X。现在,X 的新版本与 1.3 版本一起发布。我想知道,根据我项目中使用的依赖项,哪些依赖项有更新的版本可用。


阅读 60

收藏
2022-07-17

共1个答案

小编典典

Maven 版本插件和它的mojodisplay- dependency-updates是您正在寻找的:

mvn versions:display-dependency-updates

这是输出的样子:

[INFO] ------------------------------------------------------------------------
[INFO] Building Build Helper Maven Plugin
[INFO]    task-segment: [versions:display-dependency-updates]
[INFO] ------------------------------------------------------------------------
[INFO] [versions:display-dependency-updates]
[INFO]
[INFO] The following dependency updates are available:
[INFO]   org.apache.maven:maven-artifact ........................ 2.0 -> 2.0.9
[INFO]   org.apache.maven:maven-plugin-api ...................... 2.0 -> 2.0.9
[INFO]   org.apache.maven:maven-project ....................... 2.0.2 -> 2.0.9
[INFO]   org.codehaus.plexus:plexus-utils ....................... 1.1 -> 1.5.6
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17 seconds
[INFO] Finished at: Fri Aug 15 10:46:03 IST 2008
[INFO] Final Memory: 10M/167M
[INFO] ------------------------------------------------------------------------
2022-07-17