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开发工具——IDEA(修改全局配置,提升工作效率)
java·编辑器·intellij-idea
强子感冒了28 分钟前
Java网络编程学习笔记,从网络编程三要素到TCP/UDP协议
java·网络·学习
二哈喇子!31 分钟前
SpringBoot项目右上角选择ProjectNameApplication的配置
java·spring boot
sin22011 小时前
MyBatis的执行流程
java·开发语言·mybatis
二哈喇子!1 小时前
基于Spring Boot框架的车库停车管理系统的设计与实现
java·spring boot·后端·计算机毕业设计
二哈喇子!1 小时前
基于Spring Boot框架的网络游戏虚拟交易平台的设计与实现
java·springboot·毕设项目
二哈喇子!1 小时前
JAVA环境变量配置步骤及测试(JDK的下载 & 安装 & 环境配置教程)
java·开发语言
二哈喇子!1 小时前
Java框架精品项目【用于个人学习】
java·spring boot·学习
二哈喇子!2 小时前
基于SpringBoot框架的网上购书系统的设计与实现
java·大数据·spring boot
それども2 小时前
@ConditionalOnWebApplication 作用
java