Maven dependencies - version vs updates

喜欢而已 提交于 2020-07-04 07:25:45

问题


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?

回答1:


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 you'll also get jackson-databind 2.4.0 as a transitive dependency. 2.7.1-1 would be the latest available jackson-databind version.



来源:https://stackoverflow.com/questions/35354334/maven-dependencies-version-vs-updates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!