How do Maven dependency scopes and transitive dependencies work?
IntermediateConceptBuild Tools and Artifact Repositories
Answer
Scopes: compile (default, everywhere), provided (needed to compile, supplied at runtime by the container), runtime, test, system, and import (for BOMs in dependencyManagement). Transitive dependencies are pulled in automatically; conflicts are resolved by "nearest definition wins". Inspect with mvn dependency:tree and exclude or manage versions via <dependencyManagement>.
mvn dependency:tree -Dincludes=com.fasterxml.jackson.core
More on Build Tools and Artifact Repositories
What is Maven and what is its build lifecycle?BeginnerWhat is the difference between `mvn package`, `install` and `deploy`?BeginnerWhat is `settings.xml` in Maven and how do CI builds use it?IntermediateWhat is the Maven Wrapper and why use it?BeginnerHow do you cache dependencies and speed up Maven builds in CI?IntermediateWhat is the difference between `npm install` and `npm ci`?Beginner