Transitive dependencies and dependency scope
Maven's dependencies are transitive, such as A->B, B->C, then A indirectly depends on C , this is the transitivity of dependency, where A is the first direct dependence on B, B is the second direct dependence on C, and C is the transitive dependency of A.
In normal development, if our project depends on spring-core, the dependency scope is compile, and spring-core depends on commons-logging, and the dependency scope is also compile, then our project will depend on commons-logging The scope of this transitive dependency is compile. The scope of the first direct dependency and the scope of the second direct dependency determine the scope of the transitive dependency. We use the following table to illustrate, in which the leftmost column is the first direct dependency, and the top column is the second direct dependency. Crossed in the middle are transitive dependency scopes.
|
Compile |
Test | Provided |
Runtime |
##Compile | Compile | ##Runtime | ||
Test | Test | |||
Provided | Provided | Provided | ||
Runtime | Runtime |
The above is the detailed content of Detailed explanation of Maven dependency diagram examples. For more information, please follow other related articles on the PHP Chinese website!