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

相关推荐
TAEHENGV5 分钟前
基本设置模块 Cordova 与 OpenHarmony 混合开发实战
android·java·数据库
千寻技术帮15 分钟前
10422_基于Springboot的教务管理系统
java·spring boot·后端·vue·教务管理
milanleon24 分钟前
使用Spring Security进行登录认证
java·前端·spring
毕设源码-朱学姐28 分钟前
【开题答辩全过程】以 三叶草中石油信息管理系统的设计与实现为例,包含答辩的问题和答案
java·eclipse
期待のcode1 小时前
@RequestBody的伪表单提交场景
java·前端·vue.js·后端
气π1 小时前
【JavaWeb】——(若依+AI)-帝可得实践项目
java·spring
乌暮2 小时前
JavaEE初阶--多线程案例
java·java-ee
小光学长2 小时前
基于ssm旅游管理系统的开发与设计z050cft7(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
java·数据库·旅游
用户3521802454752 小时前
🥯2025 年终极避坑指南:Spring Boot 2.7 + 3.2 混合集群的 Redis + OAuth2 序列化血泪史
java·后端·spring cloud