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

相关推荐
掘金者阿豪18 分钟前
金仓数据库KingbaseES与MyBatis-Plus整合实践:电商系统开发实战
java·后端
消失的旧时光-19431 小时前
人脸跟随 ( Channel 实现(缓存5条数据 + 2度过滤 + 平滑移动))
android·java·开发语言·kotlin
默默coding的程序猿1 小时前
1.单例模式有哪几种常见的实现方式?
java·开发语言·spring boot·spring·单例模式·设计模式·idea
编程岁月1 小时前
java面试-0136-BIO、NIO、AIO区别?
java·面试·nio
春生野草1 小时前
部署项目到Tomcat
java·tomcat
安逸sgr1 小时前
SpringMVC启动流程
java·jvm·spring·spring cloud·eclipse·tomcat·maven
lifallen2 小时前
从Apache Doris 学习 HyperLogLog
java·大数据·数据仓库·算法·apache
fire-flyer2 小时前
maven-jlink-plugin入门
java·maven
Knight_AL2 小时前
Java 单元测试全攻略:JUnit 生命周期、覆盖率提升、自动化框架与 Mock 技术
java·junit·单元测试
cominglately2 小时前
记录一次生产环境数据库死锁的处理过程
java·死锁