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

相关推荐
雨中飘荡的记忆1 天前
保证金系统入门到实战
java·后端
Nyarlathotep01131 天前
Java内存模型
java
暮色妖娆丶1 天前
不过是吃了几年互联网红利罢了,我高估了自己
java·后端·面试
NE_STOP1 天前
MyBatis-参数处理与查询结果映射
java
狂奔小菜鸡1 天前
Day40 | Java中的ReadWriteLock读写锁
java·后端·java ee
SimonKing1 天前
JetBrains 用户狂喜!这个 AI 插件让 IDE 原地进化成「智能编码助手」
java·后端·程序员
狂奔小菜鸡1 天前
Day39 | Java中更灵活的锁ReentrantLock
java·后端·java ee
NE_STOP2 天前
MyBatis-配置文件解读及MyBatis为何不用编写Mapper接口的实现类
java
后端AI实验室2 天前
用AI写代码,我差点把漏洞发上线:血泪总结的10个教训
java·ai