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

相关推荐
文丑颜不良啊8 小时前
LeetCode2761~2780题目解析
java·leetcode
IT枫斗者枫哥9 小时前
子线程断言失败,JUnit 为什么还显示通过?
java·后端
考虑考虑11 小时前
JDK27中的Set.ofLazy
java·后端·java ee
文丑颜不良啊11 小时前
LeetCode2841~2860题目解析
java·leetcode
小南家的青蛙11 小时前
Tomcat与Jetty深度对比
java·tomcat·jetty
乌暮13 小时前
Spring AOP 与 Spring 事务:用大白话彻底理解原理与实践
java·数据库·spring boot·后端·sql·学习·spring
YDS82913 小时前
Small Spring IOC篇:容器事件及其监听器
java·spring
金銀銅鐵13 小时前
带您看懂字节码指令(三):一行加法里有什么
java·jvm
文丑颜不良啊13 小时前
LeetCode2921~2940题目解析
java·leetcode
北漂人Java14 小时前
基于 Spring AI Alibaba WorkFlow 构建 Java 生产级 AI Agent
java·人工智能·spring