Chapter 2. Dependency Mechanism and Scopes

In the course of this second chapter, we will study the different scopes. Then, we will see the dependencyManagement tag.

We will dive deeper in the dependency management seen for multimodule projects. In the end, we will describe the content and meaning of files in the local repository.


In the previous chapter, we have seen the groupId, artifactId, and version tags, used to determine in a deterministic way a project.

The dependency tag owns another subtag named scope.

Nomenclature of scope

The scope hints at the visibility of a dependency, relatively to the different life phases (build, test, runtime, and so on). Maven provides six scopes: compile, provided, runtime, test, system, and import.

Let's review ...

Get Apache Maven Dependency Management now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.