Maven Aggregation Modules



What is Maven?

Getting Started

Guide To Configuring Maven

Here to download Maven.

On to creating your first project! In order to create the simplest of Maven projects, execute the following from the command line:

mvn -B archetype:generate \
  -DarchetypeGroupId=org.apache.maven.archetypes \ \

Once you have executed this command, you will notice a few things have happened. First, you will notice that a directory named my-app has been created for the new project, and this directory contains a file named pom.xml that should look like this:

<project xmlns=""
  <name>Maven Quick Start Archetype</name>

Introduction To The Standard Directory Layout

Index Subdirectory Description
1 src/main/java Application/Library sources
2 src/main/resources Application/Library resources
3 src/main/filters Resource filter files
4 src/main/webapp Web application sources
5 src/test/java Test sources
6 src/test/resources Test resources
7 src/test/filters Test resource filter files
8 src/it Integration Tests (primarily for plugins)
9 src/assembly Assembly descriptors
10 src/site Site
11 LICENSE.txt Project’s license
12 NOTICE.txt Notices and attributions required by libraries that the project depends on
13 README.txt Project’s readme
14 pom.xml

Introduction to Archetypes

Introduction to the Build Lifecycle

## Compile our application resources
mvn compile
## Packaging our project
mvn package
## Install our project
mvn install

## Compile out test sources
mvn test-compile
## Run our unit tests
mvn test

## Make Maven site
mvn site

## Clean the project
mvn clean

Note that the surefire plugin (which executes the test) looks for tests contained in files with a particular naming convention. By default the tests included are:

  • **/*
  • **/Test*.java
  • **/*

And the default excludes are:

  • **/Abstract*
  • **/Abstract*

Introduction to Repositories

Guide to Configuring Plugins

How do I create documentation

mvn archetype:generate \
  -DarchetypeGroupId=org.apache.maven.archetypes \
  -DarchetypeArtifactId=maven-archetype-site \ \

Guide to creating a site

* How do I deploy my jar in my remote repository?

* How do I build more than one project at once?

See Project Aggregation.

* Introduction to the POM

* Reference for the Maven project descriptor used in Maven


  1. Getting Started with Maven
  2. Maven Getting Started Guide
  3. Introduction to the Standard Directory Layout
  4. Introduction to the POM
  5. Introduction to the POM——翻译版

  未经特别说明,本站Blog均采用署名-非商业性使用-禁止演绎 2.5 中国大陆授权。任何违反本协议的行为均属于非法行为。如需非商业性转载,请保留署名。如需商业性转载出版,请直接和联系。