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

相关推荐
chenjingming6662 分钟前
jmeter线程组设置以及串行和并行设置
java·开发语言·jmeter
殷紫川7 分钟前
深入拆解 Java volatile:从内存屏障到无锁编程的实战指南
java
eddieHoo14 分钟前
查看 Tomcat 的堆内存参数
java·tomcat
那个失眠的夜15 分钟前
Mybatis延迟加载策略
xml·java·数据库·maven·mybatis
Java成神之路-24 分钟前
SpringMVC 响应实战指南:页面、文本、JSON 返回全流程(Spring系列13)
java·spring·json
殷紫川26 分钟前
深入拆解 synchronized:从偏向锁到重量级锁的升级之旅与优化秘籍
java
Momentary_SixthSense27 分钟前
设计模式之工厂模式
java·开发语言·设计模式
殷紫川28 分钟前
深入拆解 Java 内存模型:从原子性、可见性到有序性,彻底搞懂 happen-before 规则
java·后端
殷紫川29 分钟前
ThreadLocal 深度剖析:底层实现、内存泄漏根因与生产环境避坑指南
java
砍材农夫39 分钟前
spring-ai 第六模型介绍-聊天模型
java·人工智能·spring