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

相关推荐
心之语歌几秒前
LiteFlow Spring boot使用方式
java·开发语言
计算机-秋大田1 分钟前
基于微信小程序的校园失物招领系统设计与实现(LW+源码+讲解)
java·前端·后端·微信小程序·小程序·课程设计
綦枫Maple2 分钟前
Spring Boot(6)解决ruoyi框架连续快速发送post请求时,弹出“数据正在处理,请勿重复提交”提醒的问题
java·spring boot·后端
极客先躯36 分钟前
高级java每日一道面试题-2025年01月23日-数据库篇-主键与索引有什么区别 ?
java·数据库·java高级·高级面试题·选择合适的主键·谨慎创建索引·定期评估索引的有效性
码至终章38 分钟前
kafka常用目录文件解析
java·分布式·后端·kafka·mq
Mr.Demo.43 分钟前
[Spring] Nacos详解
java·后端·spring·微服务·springcloud
luoganttcc1 小时前
华为升腾算子开发(一) helloword
java·前端·华为
Dlwyz1 小时前
Maven私服-Nexus3安装与使用
java·maven
智_永无止境1 小时前
Springboot使用war启动的配置
java·spring boot·后端·war
九月十九2 小时前
AviatorScript用法
java·服务器·前端