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

相关推荐
追随者永远是胜利者2 分钟前
(LeetCode-Hot100)32. 最长有效括号
java·算法·leetcode·职场和发展·go
lifallen4 分钟前
CDQ 分治 (CDQ Divide and Conquer)
java·数据结构·算法
笨蛋不要掉眼泪10 分钟前
OpenFeign远程调用详解:声明式实现、第三方API集成与负载均衡对比
java·运维·负载均衡
yaoxin52112314 分钟前
326. Java Stream API - 实现自定义的 toList() 与 toSet() 收集器
java·开发语言
追随者永远是胜利者15 分钟前
(LeetCode-Hot100)31. 下一个排列
java·算法·leetcode·职场和发展·go
Cosmoshhhyyy20 分钟前
《Effective Java》解读第40条:坚持使用Override注解
java·开发语言
番茄去哪了1 小时前
在Java中操作Redis
java·开发语言·数据库·redis
无心水1 小时前
6、合纵连横:开源快速开发平台全解析与自建平台架构实战【终篇】
java·后端·科技·spring·面试·架构·开源
ritxgt0061 小时前
Linux下安装Nginx服务及systemctl方式管理nginx详情
java
闻哥1 小时前
Java虚拟机内存结构深度解析:从底层原理到实战调优
java·开发语言·jvm·python·面试·springboot