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 分钟前
C# 委托(调用带引用参数的委托)
java·mysql·c#
Apex Predator9 分钟前
windows安装maven环境
java·maven
Bug退退退12318 分钟前
RabbitMQ 工作模式
java·分布式·rabbitmq
小莫分享2 小时前
github 镜像节点
java
链上Sniper2 小时前
智能合约状态快照技术:实现 EVM 状态的快速同步与回滚
java·大数据·linux·运维·web3·区块链·智能合约
缘来是庄2 小时前
设计模式之建造者模式
java·设计模式·建造者模式
小湘西3 小时前
Apache HttpClient 的请求模型和 I/O 类型
java·http·apache
沃夫上校3 小时前
Feign调Post接口异常:Incomplete output stream
java·后端·微服务
q567315233 小时前
Java Selenium反爬虫技术方案
java·爬虫·selenium
张小洛3 小时前
Spring IOC容器核心阶段解密:★Bean实例化全流程深度剖析★
java·后端·spring·ioc容器·bean实例化