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

相关推荐
Grey Zeng3 小时前
Java SE 25新增特性
java·jdk·jdk新特性·jdk25
雨白4 小时前
Java 线程通信基础:interrupt、wait 和 notifyAll 详解
android·java
架构师沉默8 小时前
设计多租户 SaaS 系统,如何做到数据隔离 & 资源配额?
java·后端·架构
Java中文社群9 小时前
重要:Java25正式发布(长期支持版)!
java·后端·面试
zjjuejin9 小时前
Maven环境搭建
后端·maven
每天进步一点_JL10 小时前
JVM 类加载:双亲委派机制
java·后端
用户2986985301411 小时前
Java HTML 转 Word 完整指南
java·后端
渣哥11 小时前
原来公平锁和非公平锁差别这么大
java
渣哥11 小时前
99% 的人没搞懂:Semaphore 到底是干啥的?
java
J2K11 小时前
JDK都25了,你还没用过ZGC?那真得补补课了
java·jvm·后端