Understanding Maven Dependency Resolution Principles

  1. Shortest Path Principle: In the case of multiple dependencies with different versions of the same JAR across different levels of dependency, Maven selects the version from the shortest path.

  2. Declaration Precedence Principle: When encountering multiple dependencies with different versions of the same JAR, and they share the same dependency path, Maven chooses the version declared first.

  3. Sibling Dependency Override Principle: When dependencies are at the same level and there are different versions of the same JAR, Maven follows the order of declaration, where later declarations override earlier ones.


See

Maven -- Introduction to the Dependency Mechanism

相关推荐
yaoxin5211232 分钟前
389. Java IO API - 获取文件名
java·开发语言·python
Wang153030 分钟前
Java排序
java
逸风尊者34 分钟前
XGBoost模型工程使用
java·后端·算法
一嘴一个橘子34 分钟前
MP 自定义业务方法 (二)
java
低客的黑调1 小时前
MyBatis-Plus-从 CRUD 到高级特性
java·servlet·tomcat
就像风一样抓不住1 小时前
Java 手机号校验工具类
java
凤山老林1 小时前
26-Java this 关键字
java·开发语言
焦糖玛奇朵婷2 小时前
解锁扭蛋机小程序的五大优势
java·大数据·服务器·前端·小程序
SamDeepThinking2 小时前
别让一个超时的第三方http接口拖垮所有接口
java·后端·架构
YaBingSec2 小时前
玄机靶场:供应链安全-供应链应急-Part2 通关笔记
java·笔记·安全