Maven 依赖项 - 版本与更新 [英] Maven dependencies - version vs updates

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

问题描述

它会告诉您是否有可用的特定依赖项的更新版本,如果有,最新版本是什么.如果有复选标记,则表示相关库已使用最新版本的依赖项 X.无论 最新 版本是什么,您都将始终获得 声明 版本的依赖项是.

因此,如果您使用 valdr-bean-validation 1.1.2(上面的示例)您还将获得 jackson-databind 2.4.0 作为传递依赖项(上面的第一行).2.7.1-1 将是最新的 jackson-databind 版本.

mvnrepository usually lists "version" and "updates" for each dependency.

  1. If I'm publishing my own package, how do I specify the "updates" version
  2. Which dependancy does Maven used when resolving transitive dependencies? So if my package depends on package A, which depends of package B with - version = 1.0 and updates = 1.1. Which version of B would I get?

解决方案

I finally understand your question. It would have been helpful for you to give us a concrete example right from the start. You're asking what the meaning of the information in the "Updates" column of MVNRepository's "Compile Dependencies" table is.

It tells you whether there's an updated version of a particular dependency available and if so what the latest version is. If there's a check mark it means the library in question already uses the latest version of dependency X. You will always get the declared version of a dependency no matter what the latest version is.

Hence, if you use valdr-bean-validation 1.1.2 (example above) you'll also get jackson-databind 2.4.0 as a transitive dependency (1st row above). 2.7.1-1 would be the latest available jackson-databind version.

这篇关于Maven 依赖项 - 版本与更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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