From the course: Introducing Maven

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Scope

Scope

From the course: Introducing Maven

Start my 1-month free trial

Scope

- [Instructor] Dependency Scope is a topic that every developer using Maven must understand to prevent issues with the way that artifacts are packaged and as such we will spend some time here talking about Scope The first Scope that we will talk about is Compile Scope. The Compile Scope is the default scope for all dependencies if not otherwise specified. As such, if you do not specify Scope, the dependency will always be compile. The compile dependency is always available in all ClassPath loaders that the artifact is in or that it goes through. All of your tests whether it's test compile, test execution, compilation, runtime, all of those class letters, the compile skill participates in. It is also propagated to other dependency trees when the artifact specifying it as a dependency in another artifact. This is called a transit of dependency. And by far this is the most common dependency type that you will deal with. Now provided dependencies are a special case that we see usually in…

Contents