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

相关推荐
冬夜戏雪几秒前
面经摘录(五)
java·后端·spring
李昊哲小课几秒前
Python CSV 模块完整教程
java·服务器·python
人道领域3 分钟前
苍穹外卖:菜品分页查询与删除功能(保姆级详解)
java·开发语言·数据库·后端·spring
亚马逊云开发者10 分钟前
MCP 到底是什么?一篇讲透:协议原理 + Bedrock 实战 + 安全防护
java
0和1的舞者43 分钟前
高并发论坛系统:单元测试 + 接口自动化 + 性能测试 + CI/CD 全链路测试报告
java·测试开发·测试工具·jmeter·pytest·测试·测试报告
空空kkk1 小时前
Java基础——代理
java·开发语言
野生技术架构师1 小时前
互联网大厂必备 Java 面试八股文真题解析
java·开发语言·面试
Rsun045511 小时前
synchronized关键字的底层实现
java
老约家的可汗1 小时前
C++篇之类和对象下
java·开发语言·c++
€8112 小时前
Java入门级教程27——ActiveMQ的下载与应用
java·开发语言·activemq·点对点文本消息发送·点对点对象消息发送·mysql+redis·序列化对象消息传输