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

相关推荐
qq_3363139321 分钟前
java基础-网络编程-TCP
java·网络·tcp/ip
咕噜咕噜啦啦1 小时前
Java期末习题速通
java·开发语言
盐真卿1 小时前
python2
java·前端·javascript
一嘴一个橘子2 小时前
mybatis - 动态语句、批量注册mapper、分页插件
java
组合缺一2 小时前
Json Dom 怎么玩转?
java·json·dom·snack4
危险、2 小时前
一套提升 Spring Boot 项目的高并发、高可用能力的 Cursor 专用提示词
java·spring boot·提示词
kaico20182 小时前
JDK11新特性
java
钊兵2 小时前
java实现GeoJSON地理信息对经纬度点的匹配
java·开发语言
jiayong232 小时前
Tomcat性能优化面试题
java·性能优化·tomcat
秋刀鱼程序编程3 小时前
Java基础入门(五)----面向对象(上)
java·开发语言