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

相关推荐
sthnyph2 分钟前
Spring Framework 中文官方文档
java·后端·spring
带刺的坐椅9 分钟前
Snack4 Json 流式解析与自动结构修复深度指南
java·llm·json·jsonpath
zb2006412013 分钟前
Spring Boot 实战篇(四):实现用户登录与注册功能
java·spring boot·后端
我命由我1234517 分钟前
Android 多进程开发 - FileDescriptor、Uri、AIDL 接口定义不能抛出异常
android·java·java-ee·kotlin·android studio·android-studio·android runtime
xyhuix24 分钟前
Spring+Quartz实现定时任务的配置方法
java
分享牛27 分钟前
Operaton入门到精通22-Operaton 2.0 升级指南:Spring Boot 4 核心变更详解
java·spring boot·后端
jinanmichael27 分钟前
SpringBoot 如何调用 WebService 接口
java·spring boot·后端
深蓝轨迹28 分钟前
吃透 Spring Boot dataSource与Starter
java·spring boot·笔记·后端
spring29979230 分钟前
springboot和springframework版本依赖关系
java·spring boot·后端
文公子WGZ40 分钟前
将java 21切换成java 25
java·开发语言