Maven - Directory Structure (Project)

Card Puncher Data Processing


Maven relies on the Standard Directory Layout

Standard project structure

A standard project

|-- pom.xml
`-- src
    |-- main
    |   `-- java
    |   |   `-- com
    |   |       `-- mycompany
    |   |           `-- app
    |   |               `--
    |   `-- sql, groovy, ...
    |   `-- resources
    |       `-- META-INF
    |           `--
    |-- test
    |   `-- java
    |   |   `-- com
    |   |       `-- mycompany
    |   |           `-- app
    |   |               `--
    |   `-- resources
    |       `--
    `-- target
        `-- classes
            `-- com
                `-- mycompany
                      `-- app
                        `-- App.class


  • the src/main/java directory contains the project source code,
  • the src/main/resources directory contains the project resources,
  • the src/test/java directory contains the test source,
  • the src/test/resources directory contains the test resources,
  • the target/classes directory contains the compiled classes
  • the pom.xml file is the project's Project Object Model, or POM.

basedir represents the directory containing pom.xml


Build pom.xml elements

<project xmlns=""

If the values of a *Directory element above is set as an absolute path (when their properties are expanded) then that directory is used. Otherwise, it is relative to the base build directory: basedir.

For resources, check the pom.xml reference and the following article Resources: Including and excluding files and directories


Documentation / Reference

Discover More
Card Puncher Data Processing
Maven - (Web)Site (Documentation) Phase

, for instance referenced in , for instance Creating contentDirectory StructureCSSmvnsite phase default where the...
Card Puncher Data Processing
Maven - Assembly (Plugin)

The assembly plugin will build assembly. An “assembly” is a group of files, directories, and dependencies that are assembled into an archive format and distributed. The plugin goals documentation...
Card Puncher Data Processing
Maven - Clean

Clean is a phase that remove the target directory
Card Puncher Data Processing
Maven - Plugin Development

How to develop a maven plugin with Java Annotation. (It's important for the configuration). The code result of this tutorial is on github. gerardnico/helloworld-maven-pluginhelloworld-maven-plugin ...
Card Puncher Data Processing
Maven - Project

A project in the Maven sense contains all little pieces that come into play to give code life. Ie: configuration files, the developers involved and the roles they play, the defect tracking system,...

Share this page:
Follow us:
Task Runner