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

相关推荐
hzc09876543218 小时前
Spring Integration + MQTT
java·后端·spring
前路不黑暗@9 小时前
Java项目:Java脚手架项目的公共模块的实现(二)
java·开发语言·spring boot·学习·spring cloud·maven·idea
人道领域9 小时前
Spring核心注解全解析
java·开发语言·spring boot
金牌归来发现妻女流落街头10 小时前
日志级别是摆设吗?
java·spring boot·日志
MOONICK10 小时前
C#基础入门
java·开发语言
程序员小假10 小时前
我们来说一下虚拟内存的概念、作用及实现原理
java·后端
悠哉清闲11 小时前
Future
java·开发语言·kotlin
徐同保11 小时前
python如何手动抛出异常
java·前端·python
极客先躯12 小时前
高级java每日一道面试题-2025年7月02日-基础篇[LangChain4j]-什么是 AiServices?它是如何简化 LLM 应用开发的?
java·开发语言
摇滚侠12 小时前
JWT 是 token 的一种格式,我的理解对吗?
java·人工智能·intellij-idea·spring ai·springaialibaba