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

相关推荐
hrhcode31 分钟前
【java工程师快速上手go】二.Go进阶特性
java·golang·go
小碗羊肉2 小时前
【从零开始学Java | 第三十一篇下】Stream流
java·开发语言
❀͜͡傀儡师3 小时前
Spring AI Alibaba vs. AgentScope:两个阿里AI框架,如何选择?
java·人工智能·spring
aq55356003 小时前
Laravel10.x重磅升级,新特性一览
android·java·开发语言
一 乐3 小时前
酒店预订|基于springboot + vue酒店预订系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·酒店预订系统
Moe4883 小时前
Spring AI Advisors:从链式增强到递归顾问
java·后端
敖正炀4 小时前
ReentrantReadWriteLock、ReentrantLock、synchronized 对比
java
cike_y4 小时前
Java反序列化漏洞-Shiro721流程分析
java·反序列化·shiro框架
极创信息4 小时前
信创系统认证服务怎么做?从适配到验收全流程指南
java·大数据·运维·tomcat·健康医疗
格鸰爱童话4 小时前
向AI学习项目技能(六)
java·人工智能·spring boot·python·学习