Background
There are three built-in build lifecycles: default, clean and site. a build lifecycles is made up of phases. clean lifecycle's phases: pre-clean clean post-clean. default lifecycle's phases: validate initialize generate-sources process-sources generate-resources process-resources compile process-classes generate-test-sources process-test-sources generate-test-resources process-test-resources test-compile process-test-classes test prepare-package package pre-integration-test integration-test post-integration-test verify install deploy. site lifecycle's phases: pre-site site post-site site-deploy. a build phase is made up of plugin goals. Each <packaging> contains a list of goals to bind to a particular phase. you can use <executions> tag to configure a mojo. (override default configuration).
Example
archiva-parent/archiva/archiva-modules/archiva-base/archiva-configuration/pom.xml
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId><!--Modello is a framework for code generation from a simple model-->
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
<execution>
<id>archiva-registry-reader</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatorId>registry-reader</generatorId>
</configuration>
</execution>
<execution>
<id>archiva-registry-writer</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatorId>registry-writer</generatorId>
</configuration>
</execution>
<execution>
<id>site-docs</id>
<phase>pre-site</phase>
<goals>
<goal>xdoc</goal>
</goals>
</execution>
</executions>
<configuration>
<version>1.4.1</version>
<models>
<model>src/main/mdo/configuration.mdo</model>
</models>
</configuration>
</plugin>
run generate-sources,
[INFO] --- modello-maven-plugin:1.7:java (default) @ archiva-configuration ---
[INFO] outputDirectory: C:\Users\l1s0n\Downloads\apache-archiva-2.2.1-src\archiva-modules\archiva-base\archiva-configuration\target\generated-sources\modello
[INFO] Working on model: src/main/mdo/configuration.mdo
[INFO] Generating current version: 1.4.1
[INFO]
[INFO] --- modello-maven-plugin:1.7:generate (archiva-registry-reader) @ archiva-configuration ---
[INFO] [modello:generate {generator: registry-reader}]
[INFO] outputDirectory: C:\Users\l1s0n\Downloads\apache-archiva-2.2.1-src\archiva-modules\archiva-base\archiva-configuration\target\generated-sources\modello
[INFO] Working on model: src/main/mdo/configuration.mdo
[INFO] Generating current version: 1.4.1
[INFO]
[INFO] --- modello-maven-plugin:1.7:generate (archiva-registry-writer) @ archiva-configuration ---
[INFO] [modello:generate {generator: registry-writer}]
[INFO] outputDirectory: C:\Users\l1s0n\Downloads\apache-archiva-2.2.1-src\archiva-modules\archiva-base\archiva-configuration\target\generated-sources\modello
[INFO] Working on model: src/main/mdo/configuration.mdo
[INFO] Generating current version: 1.4.1