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

相关推荐
王八八。1 天前
linux后台java、postSQL部署命令
java·linux·运维
月落归舟1 天前
MyBatis缓存机制
java·缓存·mybatis
huipeng9261 天前
企业级微服务开发实战(一):项目启动与工程化设计
java·开发语言·spring boot·spring cloud·微服务·云原生·架构
爱吃土豆的马铃薯ㅤㅤㅤㅤㅤㅤㅤㅤㅤ1 天前
java实现excel导入、下载模板方法
java·开发语言·excel
段ヤシ.1 天前
回顾Java知识点,面试题汇总Day12(持续更新)
java·mybatis
java1234_小锋1 天前
Spring AI 2.0 开发Java Agent智能体 - MCP(模型上下文协议)
java·人工智能·spring·spring ai
seven97_top1 天前
两小时入门Sentinel
java·sentinel
叶小鸡1 天前
Java 篇-项目实战-AI 天机学堂(从 0 到 1)-day1
java·开发语言
bigbearxyz1 天前
Caused by: java.net.SocketException: Connection reset问题排查
java·keepalived·proxysql
500841 天前
昇腾 CANN 的五层架构,到底分了哪五层
java·人工智能·分布式·架构·ocr·wpf