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

相关推荐
我是唐青枫17 分钟前
Java Jetty 实战详解:从嵌入式 HTTP 服务到 Spring Boot 容器替换
java
带刺的坐椅18 分钟前
当所有人都在用 TS/Python 写 Agent,我们为什么坚持 Java
java·ai·solon·codex·opencode·soloncode
小王师傅6625 分钟前
英语学习记
java·学习
早点睡啊Y1 小时前
深入学LangChain官方文档:Observability 与 Studio——先看清 Agent 到底做了什么
java·数据库·langchain
雨落在了我的手上1 小时前
Java数据结构(六):链表的介绍
java·开发语言·数据结构
独隅1 小时前
DevEco Code Plan+Build 双 Agent 协同开发效率实测
java·开发语言
吃饱了得干活2 小时前
@Transactional 又失效了?把这 8 个坑全填了!
java·后端·spring
今天AI了吗3 小时前
Spring AI 框架实战:Java 后端集成大模型的架构设计与工程落地
java·人工智能·python·spring·机器学习
hexu_blog3 小时前
springboot3集成shardingsphere4.0 分表分库
java·spring boot·mybatis
乐观的Terry3 小时前
9、发布系统-Webhook自动发布
java·spring boot·spring·spring cloud·mybatis