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

相关推荐
华科易迅3 分钟前
Spring装配对象方法-注解
java·后端·spring
庄周的大鱼1 小时前
分析@TransactionalEventListener注解失效
java·spring·springboot·事务监听器·spring 事件机制·事务注解失效解决
史蒂芬_丁1 小时前
C++深度拷贝例子
java·开发语言·c++
云烟成雨TD1 小时前
Spring AI Alibaba 1.x 系列【4】ReAct 范式与 ReactAgent 核心设计
java·人工智能·spring
「QT(C++)开发工程师」2 小时前
C++11三大核心特性深度解析:类型特征、时间库与原子操作
java·c++·算法
乐分启航2 小时前
SliMamba:十余K参数量刷新SOTA!高光谱分类的“降维打击“来了
java·人工智能·深度学习·算法·机器学习·分类·数据挖掘
yoothey3 小时前
Java字节流与字符流核心笔记(问答+考点复盘)
java·开发语言·笔记
black方块cxy3 小时前
实现一个输入框多个ip以逗号分隔最多20组,且ip不能重复
java·服务器·前端
23.4 小时前
【Java】char字符类型的UTF-16编码解析
java·开发语言·面试
怒放吧德德4 小时前
Spring Boot实战:InfluxDB 2.x简单教程
java·spring boot·后端