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

相关推荐
2***d885几秒前
SpringBoot 集成 Activiti 7 工作流引擎
java·spring boot·后端
五阿哥永琪1 分钟前
Spring中的定时任务怎么用?
java·后端·spring
gelald13 分钟前
AQS 工具之 CountDownLatch 与 CyclicBarry 学习笔记
java·后端·源码阅读
better_liang38 分钟前
每日Java面试场景题知识点之-XXL-JOB分布式任务调度实践
java·spring boot·xxl-job·分布式任务调度·企业级开发
会游泳的石头39 分钟前
一行注解防死循环:MyBatis 递归深度限制(无需 level 字段)
java·mybatis
q***o37640 分钟前
Spring Boot环境配置
java·spring boot·后端
oMcLin43 分钟前
如何在SUSE Linux Enterprise Server 15 SP4上通过配置并优化ZFS存储池,提升文件存储与数据备份的效率?
java·linux·运维
TaiKuLaHa1 小时前
Spring Bean的生命周期
java·后端·spring
刀法如飞1 小时前
开箱即用的 DDD(领域驱动设计)工程脚手架,基于 Spring Boot 4.0.1 和 Java 21
java·spring boot·mysql·spring·设计模式·intellij-idea