Mvn: Maven dependency management

1. Mito

Here Insert Picture Description

2. dependence

One of the core features of Maven is dependent on management. When once we begin to deal with the multi-module project (contain hundreds of sub-modules or sub-projects) and dependencies between modules becomes very complicated, management has become very difficult. For such cases, Maven provides a method for highly controlled.

3. dependent transfer

Dependent transfer is well understood that, assuming that B is dependent on C, when A rely B, then A is obtained automatically in dependence on C. Transitive dependencies sometimes very good, when we need to rely on a lot of jar package, we can declare a package to depend on all of the jar, and then just rely on this package on it. But sometimes very troublesome, because it may cause dependence conflict.

4. depend conflict

When the same project due to different package dependency same jar jar package, this time dependency collision occurs, as shown below:
Here Insert Picture Description
When the dependent project a and c, and a and c are dependent of B, then causing the conflict. To avoid conflicts, Maven uses two strategies to resolve the conflict, namely, 短路优先and 声明优先.

Guess you like

Origin blog.csdn.net/qq_21383435/article/details/105233896