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

相关推荐
云泽8081 小时前
函数模板与类模板:C++泛型编程核心解析
java·开发语言·c++
缺点内向4 小时前
Java:创建、读取或更新 Excel 文档
java·excel
带刺的坐椅5 小时前
Solon v3.4.7, v3.5.6, v3.6.1 发布(国产优秀应用开发框架)
java·spring·solon
四谎真好看6 小时前
Java 黑马程序员学习笔记(进阶篇18)
java·笔记·学习·学习笔记
桦说编程7 小时前
深入解析CompletableFuture源码实现(2)———双源输入
java·后端·源码
java_t_t7 小时前
ZIP工具类
java·zip
lang201509287 小时前
Spring Boot优雅关闭全解析
java·spring boot·后端
pengzhuofan8 小时前
第10章 Maven
java·maven
百锦再8 小时前
Vue Scoped样式混淆问题详解与解决方案
java·前端·javascript·数据库·vue.js·学习·.net
刘一说8 小时前
Spring Boot 启动慢?启动过程深度解析与优化策略
java·spring boot·后端