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

相关推荐
hssfscv1 分钟前
软件设计师下午题六——Java的各种设计模式
java·算法·设计模式
希望永不加班13 分钟前
SpringBoot 集成测试:@SpringBootTest 与 MockMvc
java·spring boot·后端·log4j·集成测试
enAn_16 分钟前
对照片和视频文件名,程序追加日期,直观看
java·maven
yaaakaaang23 分钟前
六、适配器模式
java·适配器模式
bobasyu30 分钟前
Claude Code 源码笔记 -- queryLoop
java·笔记·spring
计算机学姐41 分钟前
基于SpringBoot的高校竞赛管理系统
java·spring boot·后端·spring·信息可视化·tomcat·mybatis
AnalogElectronic44 分钟前
普通数据源和druid数据源区别以及druid参数详解
java
東雪木1 小时前
Java学习——泛型基础:泛型的核心作用、泛型类 / 方法 / 接口的定义
java·学习·java面试
一叶飘零_sweeeet1 小时前
ConcurrentHashMap 深度解析:从 JDK7 到 JDK8 的演进与并发安全保障
java·并发编程
三原1 小时前
超级好用的三原后台管理v1.0.0发布🎉(Vue3 + Ant Design Vue + Java Spring Boot )附源码
java·vue.js·开源