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

相关推荐
dllxhcjla6 小时前
微服务全套
java
亚历克斯神6 小时前
JVM 内存管理 2026:深度解析与调优实战
java·spring·微服务
逻辑驱动的ken7 小时前
Java高频面试题:03
java·开发语言·面试·求职招聘·春招
广师大-Wzx7 小时前
一篇文章看懂MySQL数据库(下)
java·开发语言·数据结构·数据库·windows·python·mysql
野生技术架构师7 小时前
Java NIO到底是个什么东西?
java·开发语言·nio
likerhood9 小时前
简单工厂设计模式
java·ide·intellij-idea
派大星酷9 小时前
Java 调用 Kimi API 实战:实现与大模型的简单对话
java·开发语言·ai编程
猫耳球团10 小时前
IDEA与Cursor跨平台协作指南
java·ide·intellij-idea
亚历克斯神10 小时前
Java 职业发展:2026 指南
java·spring·微服务
xuhaoyu_cpp_java11 小时前
Maven学习(二)
java·经验分享·笔记·学习·maven