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

相关推荐
正在努力Coding1 小时前
SpringAI - 工具调用
java·spring·ai
我尽力学2 小时前
面试 总结
java·spring boot·面试
爬台阶的蚂蚁2 小时前
Spring AI Alibaba基础概念
java·spring·ai
计算机学姐2 小时前
基于SpringBoot的演唱会抢票系统
java·spring boot·后端·spring·tomcat·intellij-idea·推荐算法
huohuopro2 小时前
Mybatis的七种传参方式
java·开发语言·mybatis
Lee_SmallNorth2 小时前
变态需求之【角色不同访问数据库的用户不同】
java·开发语言·数据库
扶苏-su2 小时前
Java网络编程:InetAddress 详解
java·开发语言·网络
Anastasiozzzz2 小时前
leetcode力扣hot100困难题--4.俩个正序数列的中位数
java·算法·leetcode·面试·职场和发展
木风小助理2 小时前
JavaStreamAPI的性能审视,优雅语法背后的隐形成本与优化实践
java·前端·数据库
Chan163 小时前
《Java并发编程的艺术》| ConcurrentHashMap 在 JDK 1.7 与 1.8 的底层实现
java·spring boot·java-ee·intellij-idea·juc