...

/

Dependency Scopes

Dependency Scopes

This lesson explains the dependency scope attribute of the dependency element and how it affects the various classpaths.

We'll cover the following...

In this lesson, we’ll work with an example consisting of three related projects with the first one dependent on the second, and the second one dependent on the third.

When a dependency is specified it is also accompanied by a scope. The scope element controls two aspects: first, if a dependency should be included with the application packaging, and second, which classpath a dependency should be included in. A classpath is the location of the classes and packages that a project is dependent on. For instance, in our three-project example. Project A depends on Project B. When compiling Project A, we need to inform the compiler of where to find the artifacts of Project B so that ...