Dependencies

Where the jar files a project builds against come from. A dependency is declared with its scope, and the six scopes are shown with the class path each one creates. Transitive dependencies follow: the seven artifacts behind one declaration, read with dependency:tree and dependency:resolve. A version conflict comes next, two versions of one library on one graph, the rule that the nearest wins, and a test run that fails because of the choice. dependencyManagement and the junit-bom import set one version for the whole graph, and the part ends in the local repository: ~/.m2/repository as a tree, mvn install writing into it and -Dmaven.repo.local moving it.

01 Declaring a dependency and its scope Declaring JUnit Jupiter and the six scopes, with the class path each scope creates. Open 02 Transitive dependencies and dependency:tree The seven artifacts behind one dependency, dependency:tree and dependency:resolve. Open 03 Version conflicts: nearest wins Two versions of one library on one graph, and a test run that fails because of the choice. Open 04 dependencyManagement and BOMs dependencyManagement and the junit-bom import: one version for the whole graph. Open 05 The local repository ~/.m2/repository as a tree, mvn install writing there, and -Dmaven.repo.local. Open

Articles