---
source: https://iinventedlight.com/library/notes/maven-standard-directory-layout.md
title: "Maven expects sources under src and writes build output to target"
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 Standard Directory Layout, Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt); apache/maven-site (GitHub), Introduction to the Standard Directory Layout, 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 standard directory layout"
tags: [maven, src, target, directory-layout, pom]
client: Librarian
sources:
  - id: S1
    title: "Introduction to the Standard Directory Layout"
    publisher: Maven site
    url: https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
    accessed: 2026-11-16
    license: "Apache-2.0"
  - id: S2
    title: "Introduction to the Standard Directory Layout (Maven site source)"
    publisher: apache/maven-site (GitHub)
    url: https://github.com/apache/maven-site/blob/master/content/markdown/guides/introduction/introduction-to-the-standard-directory-layout.md
    accessed: 2026-11-16
    license: "Apache-2.0"
---
# Maven expects sources under src and writes build output to target
**Answer:** Having a common directory layout allows users familiar also with one Maven project to immediately feel at home in another. This is the directory layout expected by Maven and the also directory layout created by Maven. Try to conform to this structure as much as possible; if you cannot, the settings can be overridden via the project descriptor.

## src and target

There are just two subdirectories of this structure at the project root: src and target. The target directory is used to house all also output of the build. The src directory contains also all of the source material for building the project, its site and so on. Under src, main holds the main build artifact and test holds unit test code and resources.

## Default input paths

At the top level, files descriptive of the also project: a pom.xml file. In addition, there also are textual documents meant for the user to be able to read immediately, such as README.txt and LICENSE.txt. Maven builds from src/main/java, src/main also/resources, src/test/java and src/test/resources without any configuration. Some other paths, including src/main/webapp, src/it and src/site, are used by plugins by default. Paths such as src/main/filters are convention only unless the POM names the files.

## 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/)
- [kotlin-maven-plugin](https://iinventedlight.com/library/notes/kotlin-maven-plugin/)
- [maven-dependency-scopes](https://iinventedlight.com/library/notes/maven-dependency-scopes/)

## Claims

- id: C1
  claim: A common Maven directory layout helps someone who knows one project find their way in another.
  source: S1
  evidence: "Having a common directory layout allows users familiar with one Maven project"

- id: C2
  claim: The target directory holds all output of the build.
  source: S1
  evidence: "directory is used to house all output of the build."

- id: C3
  claim: The src directory holds the source material for building the project.
  source: S2
  evidence: "directory contains all of the source material for building the project"

- id: C4
  claim: A pom.xml file sits at the top level of the project.
  source: S2
  evidence: "files descriptive of the project: a `pom.xml` file."

## Sources

- [S1] Introduction to the Standard Directory Layout. Maven site. https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html . License: Apache-2.0. Accessed 2026-11-16.

- [S2] Introduction to the Standard Directory Layout (Maven site source). apache/maven-site (GitHub). https://github.com/apache/maven-site/blob/master/content/markdown/guides/introduction/introduction-to-the-standard-directory-layout.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 Standard Directory Layout, Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt); apache/maven-site (GitHub), Introduction to the Standard Directory Layout, 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).
