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

相关推荐
开发者小天4 小时前
python中For Loop的用法
java·服务器·python
flushmeteor4 小时前
JDK源码-基础类-String
java·开发语言
毕设源码-钟学长4 小时前
【开题答辩全过程】以 基于ssm的空中停车场管理系统为例,包含答辩的问题和答案
java
不愿是过客4 小时前
java实战干货——长方法深递归
java
小北方城市网5 小时前
Redis 分布式锁高可用实现:从原理到生产级落地
java·前端·javascript·spring boot·redis·分布式·wpf
六义义6 小时前
java基础十二
java·数据结构·算法
毕设源码-钟学长7 小时前
【开题答辩全过程】以 基于SpringBoot的智能书城推荐系统的设计与实现为例,包含答辩的问题和答案
java·spring boot·后端
笨手笨脚の7 小时前
深入理解 Java 虚拟机-03 垃圾收集
java·jvm·垃圾回收·标记清除·标记复制·标记整理
莫问前路漫漫7 小时前
WinMerge v2.16.41 中文绿色版深度解析:文件对比与合并的全能工具
java·开发语言·python·jdk·ai编程
九皇叔叔8 小时前
【03】SpringBoot3 MybatisPlus BaseMapper 源码分析
java·开发语言·mybatis·mybatis plus