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

相关推荐
bagadesu2 小时前
使用Docker构建Node.js应用的详细指南
java·后端
没有bug.的程序员2 小时前
Spring Cloud Gateway 性能优化与限流设计
java·spring boot·spring·nacos·性能优化·gateway·springcloud
洛_尘3 小时前
JAVA EE初阶 2: 多线程-初阶
java·开发语言
Slow菜鸟3 小时前
Java 开发环境安装指南(五) | Git 安装
java·git
lkbhua莱克瓦244 小时前
Java基础——方法
java·开发语言·笔记·github·学习方法
q***71855 小时前
海康威视摄像头ISUP(原EHOME协议) 摄像头实时预览springboot 版本java实现,并可以在浏览器vue前端播放(附带源码)
java·前端·spring boot
_Jimmy_5 小时前
JUC包里的同步组件主要实现了AQS的哪些主要方法
java
范纹杉想快点毕业5 小时前
《嵌入式开发硬核指南:91问一次讲透底层到架构》
java·开发语言·数据库·单片机·嵌入式硬件·mongodb
大G的笔记本5 小时前
Java常见设计模式面试题(高频)
java·开发语言·设计模式
老鼠只爱大米5 小时前
Java设计模式之建造者模式(Builder)详解
java·设计模式·建造者模式·builder·23种设计模式