dependency scope
A Maven setting on a dependency that says when it is on the class path, such as only while compiling and running tests.
In more detail
A dependency in the test scope, such as JUnit, is available while tests compile and run and is left out of the packaged artifact. The default scope, compile, is available everywhere and ships with the application. Gradle expresses the same idea with configurations such as testImplementation.
Example
<scope>test</scope>Related terms
- dependency — Anything a program needs in order to work, such as a library, a tool or another service.
- class path — The list of folders and JAR files the JVM and the compiler search to find classes.
- dependency configuration — The name in front of a Gradle dependency, such as testImplementation, that says where and when that dependency is used.
Taught in
- The Toolchain: Maven — Modern Java: Virtual Threads & High-Throughput Services