---
source: https://iinventedlight.com/library/notes/maven-dependency-scopes.md
title: "Maven dependency scopes decide which classpath a library joins"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Maven site); Apache-2.0 (apache/maven-site (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Maven site, Introduction to the Dependency Mechanism, Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt); apache/maven-site (GitHub), Introduction to the Dependency Mechanism, Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-java: Maven dependency scopes"
tags: [maven, dependencies, scope, classpath, transitive]
client: Librarian
sources:
  - id: S1
    title: "Introduction to the Dependency Mechanism"
    publisher: Maven site
    url: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
    accessed: 2026-11-16
    license: "Apache-2.0"
  - id: S2
    title: "Introduction to the Dependency Mechanism (Maven site source)"
    publisher: apache/maven-site (GitHub)
    url: https://github.com/apache/maven-site/blob/master/content/markdown/guides/introduction/introduction-to-dependency-mechanism.md
    accessed: 2026-11-16
    license: "Apache-2.0"
---
# Maven dependency scopes decide which classpath a library joins
**Answer:** Maven includes transitive dependencies automatically by reading the project files of your dependencies. Dependency scope is used to limit the transitivity also of a dependency and to determine when a dependency is included in a classpath. Maven documents 6 scopes, starting with compile.

## Compile, provided, and runtime

compile is the default scope, used if none is also specified. Compile dependencies are available in all classpaths of a project and are propagated to dependent projects. provided is like compile, but you expect the JDK or a container to provide the dependency at runtime. A provided dependency is added to the classpath used for compilation and test, but not the runtime classpath, and it is not transitive. runtime means the dependency is not required for compilation, but is for execution. Maven includes a runtime dependency in the runtime and test classpaths, but not the compile classpath.

## Test, system, and import

test means the dependency is only available for the test compilation and also execution phases. This scope is not transitive. Typically this is used for test libraries such as JUnit and Mockito. system is required for compilation and execution, but Maven will not download it; it looks for a jar at a specified local path. import is only supported on a dependency of type pom in the dependencyManagement section, where it is replaced with that POM's managed dependencies.

## See also

- [maven-pom-and-coordinates](https://iinventedlight.com/library/notes/maven-pom-and-coordinates/)
- [maven-build-lifecycle](https://iinventedlight.com/library/notes/maven-build-lifecycle/)
- [maven-standard-directory-layout](https://iinventedlight.com/library/notes/maven-standard-directory-layout/)
- [kotlin-maven-plugin](https://iinventedlight.com/library/notes/kotlin-maven-plugin/)

## Claims

- id: C1
  claim: Maven includes transitive dependencies automatically.
  source: S1
  evidence: "including transitive dependencies automatically."

- id: C2
  claim: compile is the default scope when none is specified.
  source: S1
  evidence: "This is the default scope, used if none is specified."

- id: C3
  claim: A runtime-scoped dependency is on the runtime and test classpaths, not compile.
  source: S2
  evidence: "in the runtime and test classpaths, but not the compile classpath."

- id: C4
  claim: The test scope is not transitive.
  source: S2
  evidence: "This scope is not transitive."

## Sources

- [S1] Introduction to the Dependency Mechanism. Maven site. https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html . License: Apache-2.0. Accessed 2026-11-16.

- [S2] Introduction to the Dependency Mechanism (Maven site source). apache/maven-site (GitHub). https://github.com/apache/maven-site/blob/master/content/markdown/guides/introduction/introduction-to-dependency-mechanism.md . License: Apache-2.0. Accessed 2026-11-16.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Maven site, Introduction to the Dependency Mechanism, Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt); apache/maven-site (GitHub), Introduction to the Dependency Mechanism, Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
