maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r806981 [23/46] - in /websites/staging/maventest/trunk/content: ./ ant/ background/ css/ developers/ developers/conventions/ developers/release/ developers/website/ docs/ docs/2.0.1/ docs/2.0.10/ docs/2.0.11/ docs/2.0.2/ docs/2.0.3/ docs/2....
Date Thu, 01 Mar 2012 23:09:05 GMT
Added: websites/staging/maventest/trunk/content/guides/introduction/introduction-to-the-lifecycle.html
==============================================================================
--- websites/staging/maventest/trunk/content/guides/introduction/introduction-to-the-lifecycle.html (added)
+++ websites/staging/maventest/trunk/content/guides/introduction/introduction-to-the-lifecycle.html Thu Mar  1 23:08:58 2012
@@ -0,0 +1,274 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- Generated by Apache Maven Doxia at Mar 1, 2012 -->
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Introduction to the Build Lifecycle</title>
+    <style type="text/css" media="all">
+      @import url("../../css/maven-base.css");
+      @import url("../../css/maven-theme.css");
+      @import url("../../css/site.css");
+    </style>
+    <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
+        <meta name="author" content="Brett Porter" />
+        <meta name="Date-Revision-yyyymmdd" content="20120301" />
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+                                                    
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
+                                                        
+<script type="text/javascript">_uacct = "UA-140879-1";
+        urchinTracker();</script>
+                    </head>
+  <body class="composite">
+    <div id="banner">
+                                      <a href="../.././" id="bannerLeft">
+                                                <img src="../../images/apache-maven-project-2.png" alt="" />
+                </a>
+                        <span id="bannerRight">
+                                                <img src="../../images/maven-logo-2.gif" alt="" />
+                </span>
+            <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="breadcrumbs">
+            
+                                <div class="xleft">
+                          <a href="http://www.apache.org/" class="externalLink">Apache</a>
+        &gt;
+                  <a href="../../index.html">Maven</a>
+        &gt;
+    Introduction to the Build Lifecycle
+      </div>
+            <div class="xright">        
+                                 Last Published: 2012-03-01
+            </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="leftColumn">
+      <div id="navcolumn">
+             
+                                                <h5>Main</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../index.html">Welcome</a>
+            </li>
+          </ul>
+                       <h5>Get Maven</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../download.html">Download</a>
+            </li>
+                  <li class="none">
+                  <a href="../../docs/3.0.4/release-notes.html">Release Notes (3.0.4)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../docs/2.2.1/release-notes.html">Release Notes (2.2.1)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../docs/2.0.11/release-notes.html">Release Notes (2.0.11)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../license.html">License</a>
+            </li>
+          </ul>
+                       <h5>IDE Integration</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../eclipse-plugin.html">Eclipse</a>
+            </li>
+                  <li class="none">
+                  <a href="../../netbeans-module.html">NetBeans</a>
+            </li>
+          </ul>
+                       <h5>About Maven</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../what-is-maven.html">What is Maven?</a>
+            </li>
+                  <li class="none">
+                  <a href="../../maven-features.html">Features</a>
+            </li>
+                  <li class="none">
+                  <a href="../../general.html">FAQ (official)</a>
+            </li>
+                  <li class="none">
+                  <a href="http://docs.codehaus.org/display/MAVENUSER/FAQs-1" class="externalLink">FAQ (unofficial)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../powered-by-m2.html">Powered By</a>
+            </li>
+          </ul>
+                       <h5>Documentation</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../plugins/index.html">Maven Plugins</a>
+            </li>
+                  <li class="none">
+                  <a href="../../guides/index.html">Index (category)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../run-maven/index.html">Running Maven</a>
+            </li>
+                                                                                                                                            <li class="collapsed">
+                  <a href="../../users/index.html">User Centre</a>
+                  </li>
+                                                                                                        <li class="collapsed">
+                  <a href="../../plugin-developers/index.html">Plugin Developer Centre</a>
+                  </li>
+                  <li class="none">
+                  <a href="../../repository/index.html">Maven Repository Centre</a>
+            </li>
+                  <li class="none">
+                  <a href="../../developers/index.html">Maven Developer Centre</a>
+            </li>
+                  <li class="none">
+                  <a href="../../articles.html">Books and Resources</a>
+            </li>
+                  <li class="none">
+                  <a href="http://docs.codehaus.org/display/MAVENUSER/Home" class="externalLink">Wiki</a>
+            </li>
+          </ul>
+                       <h5>Community</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../community.html">Community Overview</a>
+            </li>
+                  <li class="none">
+                  <a href="../../guides/development/guide-helping.html">How to Contribute</a>
+            </li>
+                  <li class="none">
+                  <a href="../../guides/mini/guide-maven-evangelism.html">Maven Repository</a>
+            </li>
+                  <li class="none">
+                  <a href="../../users/getting-help.html">Getting Help</a>
+            </li>
+                  <li class="none">
+                  <a href="../../issue-tracking.html">Issue Tracking</a>
+            </li>
+                  <li class="none">
+                  <a href="../../source-repository.html">Source Repository</a>
+            </li>
+                  <li class="none">
+                  <a href="../../team-list.html">The Maven Team</a>
+            </li>
+          </ul>
+                       <h5>Project Documentation</h5>
+                  <ul>
+                                                                                                                          <li class="collapsed">
+                  <a href="../../project-info.html">Project Information</a>
+                  </li>
+          </ul>
+                       <h5>Maven Projects</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../ant-tasks/index.html">Ant Tasks</a>
+            </li>
+                  <li class="none">
+                  <a href="../../archetype/index.html">Archetype</a>
+            </li>
+                  <li class="none">
+                  <a href="../../doxia/index.html">Doxia</a>
+            </li>
+                  <li class="none">
+                  <a href="../../jxr/index.html">JXR</a>
+            </li>
+                  <li class="none">
+                  <a href="../../maven-1.x/index.html">Maven 1.x</a>
+            </li>
+                  <li class="none">
+                  <a href="../../index.html">Maven 2 & 3</a>
+            </li>
+                  <li class="none">
+                  <a href="../../plugins/index.html">Plugins</a>
+            </li>
+                  <li class="none">
+                  <a href="../../scm/index.html">SCM</a>
+            </li>
+                  <li class="none">
+                  <a href="../../shared/index.html">Shared Components</a>
+            </li>
+                  <li class="none">
+                  <a href="../../surefire/index.html">Surefire</a>
+            </li>
+                  <li class="none">
+                  <a href="../../wagon/index.html">Wagon</a>
+            </li>
+          </ul>
+                       <h5>ASF</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink">How Apache Works</a>
+            </li>
+                  <li class="none">
+                  <a href="http://www.apache.org/foundation/" class="externalLink">Foundation</a>
+            </li>
+                  <li class="none">
+                  <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink">Sponsoring Apache</a>
+            </li>
+                  <li class="none">
+                  <a href="http://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a>
+            </li>
+          </ul>
+                                 <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+          <img alt="Built by Maven" src="../../images/logos/maven-feather.png"/>
+        </a>
+                       
+                            </div>
+    </div>
+    <div id="bodyColumn">
+      <div id="contentBox">
+        <!-- Copyright 2006 The Apache Software Foundation. --><!--  --><!-- Licensed under the Apache License, Version 2.0 (the "License"); --><!-- you may not use this file except in compliance with the License. --><!-- You may obtain a copy of the License at --><!--  --><!-- http://www.apache.org/licenses/LICENSE-2.0 --><!--  --><!-- Unless required by applicable law or agreed to in writing, software --><!-- distributed under the License is distributed on an "AS IS" BASIS, --><!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --><!-- See the License for the specific language governing permissions and --><!-- limitations under the License. --><!-- NOTE: For help with the syntax of this file, see: --><!-- http://maven.apache.org/doxia/references/apt-format.html --><div class="section"><h2>Introduction to the Build Lifecycle<a name="Introduction_to_the_Build_Lifecycle"></a></h2><div class="section"><h3>Table Of Contents<a name="Table_Of_Contents"><
 /a></h3><ul><li><a href="#Build_Lifecycle_Basics">Build Lifecycle Basics</a></li><li><a href="#Setting_Up_Your_Project_to_Use_the_Build_Lifecycle">Setting Up Your Project to Use the Build Lifecycle</a><ul><li><a href="#Packaging">Packaging</a></li><li><a href="#Plugins">Plugins</a></li></ul></li><li><a href="#Lifecycle_Reference">Lifecycle Reference</a></li><li><a href="#Built-in_Lifecycle_Bindings">Built-in Lifecycle Bindings</a></li></ul></div><div class="section"><h3><a name="Build_Lifecycle_Basics">Build Lifecycle Basics</a></h3><p>Maven 2.0 is based around the central concept of a build lifecycle. What this means is that the process for building and distributing a particular artifact (project) is clearly defined.</p><p>For the person building a project, this means that it is only necessary to learn a small set of commands to build any Maven project, and the <a href="./introduction-to-the-pom.html">POM</a> will ensure they get the results they desired.</p><p>There are th
 ree built-in build lifecycles: default, clean and site. The default lifecycle handles your project deployment, the clean lifecycle handles project cleaning, while the site lifecycle handles the creation of your project's site documentation.</p><div class="section"><h4><a name="A_Build_Lifecycle_is_Made_Up_of_Phases">A Build Lifecycle is Made Up of Phases</a></h4><p>Each of these build lifecycles is defined by a different list of build phases, wherein a build phase represents a stage in the lifecycle.</p><p>For example, the default lifecycle has the following build phases (for a complete list of the build phases, refer to the <a href="#Lifecycle_Reference">Lifecycle Reference</a>):</p><ul><li><tt>validate</tt> - validate the project is correct and all necessary information is available</li><li><tt>compile</tt> - compile the source code of the project</li><li><tt>test</tt> - test the compiled source code using a suitable unit testing framework. These tests should not require t
 he code be packaged or deployed</li><li><tt>package</tt> - take the compiled code and package it in its distributable format, such as a JAR.</li><li><tt>integration-test</tt> - process and deploy the package if necessary into an environment where integration tests can be run</li><li><tt>verify</tt> - run any checks to verify the package is valid and meets quality criteria</li><li><tt>install</tt> - install the package into the local repository, for use as a dependency in other projects locally</li><li><tt>deploy</tt> - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.</li></ul><p>These build phases (plus the other build phases not shown here) are executed sequentially to complete the default lifecycle. Given the build phases above, this means that when the default lifecycle is used, Maven will first validate the project, then will try to compile the sources, run those against the t
 ests, package the binaries (e.g. jar), run integration tests against that package, verify the package, install the verifed package to the local repository, then deploy the installed package in a specified environment.</p><p>To do all those, you only need to call the last build phase to be executed, in this case, <tt>deploy</tt>:</p><div><pre>mvn deploy</pre></div><p>That is because if you call a build phase, it will execute not only that build phase, but also every build phase prior to the called build phase. Thus, doing</p><div><pre>mvn integration-test</pre></div><p>will do every build phase before it (<tt>validate</tt>, <tt>compile</tt>, <tt>package</tt>, etc.), before executing <tt>integration-test</tt>.</p><p>There are more commands that are part of the lifecycle, which will be discussed in the following sections.</p><p>It should also be noted that the same command can be used in a multi-module scenario (i.e. a project with one or more subprojects). For example:</p><div
 ><pre>mvn clean install</pre></div><p>This command will traverse into all of the subprojects and run <tt>clean</tt>, then <tt>install</tt> (including all of the prior steps).</p><p><i><a href="./introduction-to-the-lifecycle.html">[top]</a>.</i></p></div><div class="section"><h4><a name="A_Build_Phase_is_Made_Up_of_Goals">A Build Phase is Made Up of Goals</a></h4><p>However, even though a build phase is responsible for a specific step in the build lifecycle, the manner in which it carries out those responsibilities may vary. And this is done by declaring the goals bound to those build phases.</p><p>A goal represents a specific task (finer than a build phase) which contributes to the building and managing of a project. It may be bound to zero or more build phases. A goal not bound to any build phase could be executed outside of the build lifecycle by direct invocation. The order of execution depends on the order in which the goal(s) and the build phase(s) are invoked. For exa
 mple, consider the command below. The <tt>clean</tt> and <tt>package</tt> arguments are build phases while the <tt>dependency:copy-dependencies</tt> is a goal.</p><div><pre>mvn clean dependency:copy-dependencies package</pre></div><p>If this were to be executed, the <tt>clean</tt> phase will be executed first (meaning it will run all preceeding phases of the clean lifecycle, plus the <tt>clean</tt> phase itself), and then the <tt>dependency:copy-dependencies</tt> goal, before finally executing the <tt>package</tt> phase (and all its preceeding build phases of the default lifecycle).</p><p>Moreover, if a goal is bound to one or more build phases, that goal will be called in all those phases.</p><p>Furthermore, a build phase can also have zero or more goals bound to it. If a build phase has no goals bound to it, that build phase will not execute. But if it has one or more goals bound to it, it will execute all those goals (<i>Note: In Maven 2.0.5 and above, multiple goals boun
 d to a phase are executed in the same order as they are declared in the POM, however multiple instances of the same plugin are not supported. Multiple instances of the same plugin are grouped to execute together and ordered in Maven 2.0.11 and above</i>).</p><p><i><a href="./introduction-to-the-lifecycle.html">[top]</a>.</i></p></div></div><div class="section"><h3><a name="Setting_Up_Your_Project_to_Use_the_Build_Lifecycle">Setting Up Your Project to Use the Build Lifecycle</a></h3><p>The build lifecycle is simple enough to use, but when you are constructing a Maven build for a project, how do you go about assigning tasks to each of those build phases?</p><div class="section"><h4><a name="Packaging">Packaging</a></h4><p>The first, and most common way, is to set the packaging for your project via the equally named POM element <tt>&lt;packaging&gt;</tt>. Some of the valid packaging values are <tt>jar</tt>, <tt>war</tt>, <tt>ear</tt> and <tt>pom</tt>. If no packaging value has 
 been specified, it will default to <tt>jar</tt>.</p><p>Each packaging contains a list of goals to bind to a particular phase. For example, the <tt>jar</tt> packaging will bind the following goals to build phases of the default lifecycle.</p><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>process-resources</tt></td><td align="left"><tt>resources:resources</tt></td></tr><tr class="b"><td align="left"><tt>compile</tt></td><td align="left"><tt>compiler:compile</tt></td></tr><tr class="a"><td align="left"><tt>process-test-resources</tt></td><td align="left"><tt>resources:testResources</tt></td></tr><tr class="b"><td align="left"><tt>test-compile</tt></td><td align="left"><tt>compiler:testCompile</tt></td></tr><tr class="a"><td align="left"><tt>test</tt></td><td align="left"><tt>surefire:test</tt></td></tr><tr class="b"><td align="left"><tt>package</tt></td><td align="left"><tt>jar:jar</tt></td></tr><tr class="a"><td align="left"><tt>install</tt></td><td ali
 gn="left"><tt>install:install</tt></td></tr><tr class="b"><td align="left"><tt>deploy</tt></td><td align="left"><tt>deploy:deploy</tt></td></tr></table><p>This is an almost standard set of bindings; however, some packagings handle them differently. For example, a project that is purely metadata (packaging value is <tt>pom</tt>) only binds goals to the <tt>install</tt> and <tt>deploy</tt> phases (for a complete list of goal-to-build-phase bindings of some of the packaging types, refer to the <a href="#Lifecycle_Reference">Lifecycle Reference</a>).</p><p>Note that for some packaging types to be available, you may also need to include a particular plugin in the <tt>&lt;build&gt;</tt> section of your POM and specify <tt>&lt;extensions&gt;true&lt;/extensions&gt;</tt> for that plugin. One example of a plugin that requires this is the Plexus plugin, which provides a <tt>plexus-application</tt> and <tt>plexus-service</tt> packaging.</p><p><i><a href="./introduction-to-the-lifecycle.
 html">[top]</a>.</i></p></div><div class="section"><h4><a name="Plugins">Plugins</a></h4><p>The second way to add goals to phases is to configure plugins in your project. Plugins are artifacts that provide goals to Maven. Furthermore, a plugin may have one or more goals wherein each goal represents a capability of that plugin. For example, the Compiler plugin has two goals: <tt>compile</tt> and <tt>testCompile</tt>. The former compiles the source code of your main code, while the later compiles the source code of your test code.</p><p>As you will see in the later sections, plugins can contain information that indicates which lifecycle phase to bind a goal to. Note that adding the plugin on its own is not enough information - you must also specify the goals you want to run as part of your build.</p><p>The goals that are configured will be added to the goals already bound to the lifecycle from the packaging selected. If more than one goal is bound to a particular phase, the or
 der used is that those from the packaging are executed first, followed by those configured in the POM. Note that you can use the <tt>&lt;executions&gt;</tt> element to gain more control over the order of particular goals.</p><p>For example, the Modello plugin binds by default its goal <tt>modello:java</tt> to the <tt>generate-sources</tt> phase (Note: The <tt>modello:java</tt> goal generates Java source codes). So to use the Modello plugin and have it generate sources from a model and incorporate that into the build, you would add the following to your POM in the <tt>&lt;plugins&gt;</tt> section of <tt>&lt;build&gt;</tt>:</p><div><pre>...
+ &lt;plugin&gt;
+   &lt;groupId&gt;org.codehaus.modello&lt;/groupId&gt;
+   &lt;artifactId&gt;modello-maven-plugin&lt;/artifactId&gt;
+   &lt;version&gt;1.4&lt;/version&gt;
+   &lt;executions&gt;
+     &lt;execution&gt;
+       &lt;configuration&gt;
+         &lt;models&gt;
+           &lt;model&gt;src/main/mdo/maven.mdo&lt;/model&gt;
+         &lt;/models&gt;
+         &lt;version&gt;4.0.0&lt;/version&gt;
+       &lt;/configuration&gt;
+       &lt;goals&gt;
+         &lt;goal&gt;java&lt;/goal&gt;
+       &lt;/goals&gt;
+     &lt;/execution&gt;
+   &lt;/executions&gt;
+ &lt;/plugin&gt;
+...</pre></div><p>You might be wondering why that <tt>&lt;executions&gt;</tt> element is there. That is so that you can run the same goal multiple times with different configuration if needed. Separate executions can also be given an ID so that during inheritance or the application of profiles you can control whether goal configuration is merged or turned into an additional execution.</p><p>When multiple executions are given that match a particular phase, they are executed in the order specified in the POM, with inherited executions running first.</p><p>Now, in the case of <tt>modello:java</tt>, it only makes sense in the <tt>generate-sources</tt> phase. But some goals can be used in more than one phase, and there may not be a sensible default. For those, you can specify the phase yourself. For example, let's say you have a goal <tt>display:time</tt> that echos the current time to the commandline, and you want it to run in the <tt>process-test-resources</tt> phase to indicat
 e when the tests were started. This would be configured like so:</p><div><pre>...
+ &lt;plugin&gt;
+   &lt;groupId&gt;com.mycompany.example&lt;/groupId&gt;
+   &lt;artifactId&gt;display-maven-plugin&lt;/artifactId&gt;
+   &lt;version&gt;1.0&lt;/version&gt;
+   &lt;executions&gt;
+     &lt;execution&gt;
+       &lt;phase&gt;process-test-resources&lt;/phase&gt;
+       &lt;goals&gt;
+         &lt;goal&gt;time&lt;/goal&gt;
+       &lt;/goals&gt;
+     &lt;/execution&gt;
+   &lt;/executions&gt;
+ &lt;/plugin&gt;
+...</pre></div><p><i><a href="./introduction-to-the-lifecycle.html">[top]</a>.</i></p></div></div><div class="section"><h3><a name="Lifecycle_Reference">Lifecycle Reference</a></h3><p>The following lists all build phases of the default, clean and site lifecycle, which are executed in the order given up to the point of the one specified.</p><p><b>Clean Lifecycle</b></p><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>pre-clean</tt></td><td align="left">executes processes needed prior to the actual project cleaning</td></tr><tr class="b"><td align="left"><tt>clean</tt></td><td align="left">remove all files generated by the previous build</td></tr><tr class="a"><td align="left"><tt>post-clean</tt></td><td align="left">executes processes needed to finalize the project cleaning</td></tr></table><p><b>Default Lifecycle</b></p><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>validate</tt></td><td align="left">validate the project is corre
 ct and all necessary information is available.</td></tr><tr class="b"><td align="left"><tt>initialize</tt></td><td align="left">initialize build state, e.g. set properties or create directories.</td></tr><tr class="a"><td align="left"><tt>generate-sources</tt></td><td align="left">generate any source code for inclusion in compilation.</td></tr><tr class="b"><td align="left"><tt>process-sources</tt></td><td align="left">process the source code, for example to filter any values.</td></tr><tr class="a"><td align="left"><tt>generate-resources</tt></td><td align="left">generate resources for inclusion in the package.</td></tr><tr class="b"><td align="left"><tt>process-resources</tt></td><td align="left">copy and process the resources into the destination directory, ready for packaging.</td></tr><tr class="a"><td align="left"><tt>compile</tt></td><td align="left">compile the source code of the project.</td></tr><tr class="b"><td align="left"><tt>process-classes</tt></td><td align=
 "left">post-process the generated files from compilation, for example to do bytecode enhancement on Java classes.</td></tr><tr class="a"><td align="left"><tt>generate-test-sources</tt></td><td align="left">generate any test source code for inclusion in compilation.</td></tr><tr class="b"><td align="left"><tt>process-test-sources</tt></td><td align="left">process the test source code, for example to filter any values.</td></tr><tr class="a"><td align="left"><tt>generate-test-resources</tt></td><td align="left">create resources for testing.</td></tr><tr class="b"><td align="left"><tt>process-test-resources</tt></td><td align="left">copy and process the resources into the test destination directory.</td></tr><tr class="a"><td align="left"><tt>test-compile</tt></td><td align="left">compile the test source code into the test destination directory</td></tr><tr class="b"><td align="left"><tt>process-test-classes</tt></td><td align="left">post-process the generated files from test c
 ompilation, for example to do bytecode enhancement on Java classes. For Maven 2.0.5 and above.</td></tr><tr class="a"><td align="left"><tt>test</tt></td><td align="left">run tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed.</td></tr><tr class="b"><td align="left"><tt>prepare-package</tt></td><td align="left">perform any operations necessary to prepare a package before the actual packaging. This often results in an unpacked, processed version of the package. (Maven 2.1 and above)</td></tr><tr class="a"><td align="left"><tt>package</tt></td><td align="left">take the compiled code and package it in its distributable format, such as a JAR.</td></tr><tr class="b"><td align="left"><tt>pre-integration-test</tt></td><td align="left">perform actions required before integration tests are executed. This may involve things such as setting up the required environment.</td></tr><tr class="a"><td align="left"><tt>integration-tes
 t</tt></td><td align="left">process and deploy the package if necessary into an environment where integration tests can be run.</td></tr><tr class="b"><td align="left"><tt>post-integration-test</tt></td><td align="left">perform actions required after integration tests have been executed. This may including cleaning up the environment.</td></tr><tr class="a"><td align="left"><tt>verify</tt></td><td align="left">run any checks to verify the package is valid and meets quality criteria.</td></tr><tr class="b"><td align="left"><tt>install</tt></td><td align="left">install the package into the local repository, for use as a dependency in other projects locally.</td></tr><tr class="a"><td align="left"><tt>deploy</tt></td><td align="left">done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.</td></tr></table><p><b>Site Lifecycle</b></p><table border="1" class="bodyTable"><tr class="a"><td alig
 n="left">pre-site</td><td align="left">executes processes needed prior to the actual project site generation</td></tr><tr class="b"><td align="left">site</td><td align="left">generates the project's site documentation</td></tr><tr class="a"><td align="left">post-site</td><td align="left">executes processes needed to finalize the site generation, and to prepare for site deployment</td></tr><tr class="b"><td align="left">site-deploy</td><td align="left">deploys the generated site documentation to the specified web server</td></tr></table><p><i><a href="./introduction-to-the-lifecycle.html">[top]</a>.</i></p></div><div class="section"><h3><a name="Built-in_Lifecycle_Bindings">Built-in Lifecycle Bindings</a></h3><p>Some phases have goals binded to them by default. And for the default lifecycle, these bindings depend on the packaging value. Here are some of the goal-to-build-phase bindings.</p><div class="section"><h4>Clean Lifecycle Bindings<a name="Clean_Lifecycle_Bindings"></a
 ></h4><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>clean</tt></td><td align="left"><tt>clean:clean</tt></td></tr></table></div><div class="section"><h4>Default Lifecycle Bindings - Packaging <tt>ejb</tt> / <tt>ejb3</tt> / <tt>jar</tt> / <tt>par</tt> / <tt>rar</tt> / <tt>war</tt><a name="Default_Lifecycle_Bindings_-_Packaging_ejb__ejb3__jar__par__rar__war"></a></h4><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>process-resources</tt></td><td align="left"><tt>resources:resources</tt></td></tr><tr class="b"><td align="left"><tt>compile</tt></td><td align="left"><tt>compiler:compile</tt></td></tr><tr class="a"><td align="left"><tt>process-test-resources</tt></td><td align="left"><tt>resources:testResources</tt></td></tr><tr class="b"><td align="left"><tt>test-compile</tt></td><td align="left"><tt>compiler:testCompile</tt></td></tr><tr class="a"><td align="left"><tt>test</tt></td><td align="left"><tt>surefire:test</tt></td></tr><t
 r class="b"><td align="left"><tt>package</tt></td><td align="left"><tt>ejb:ejb</tt> <i>or</i> <tt>ejb3:ejb3</tt> <i>or</i> <tt>jar:jar</tt> <i>or</i> <tt>par:par</tt> <i>or</i> <tt>rar:rar</tt> <i>or</i> <tt>war:war</tt></td></tr><tr class="a"><td align="left"><tt>install</tt></td><td align="left"><tt>install:install</tt></td></tr><tr class="b"><td align="left"><tt>deploy</tt></td><td align="left"><tt>deploy:deploy</tt></td></tr></table></div><div class="section"><h4>Default Lifecycle Bindings - Packaging <tt>ear</tt><a name="Default_Lifecycle_Bindings_-_Packaging_ear"></a></h4><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>generate-resources</tt></td><td align="left"><tt>ear:generateApplicationXml</tt></td></tr><tr class="b"><td align="left"><tt>process-resources</tt></td><td align="left"><tt>resources:resources</tt></td></tr><tr class="a"><td align="left"><tt>package</tt></td><td align="left"><tt>ear:ear</tt></td></tr><tr class="b"><td align="left">
 <tt>install</tt></td><td align="left"><tt>install:install</tt></td></tr><tr class="a"><td align="left"><tt>deploy</tt></td><td align="left"><tt>deploy:deploy</tt></td></tr></table></div><div class="section"><h4>Default Lifecycle Bindings - Packaging <tt>maven-plugin</tt><a name="Default_Lifecycle_Bindings_-_Packaging_maven-plugin"></a></h4><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>generate-resources</tt></td><td align="left"><tt>plugin:descriptor</tt></td></tr><tr class="b"><td align="left"><tt>process-resources</tt></td><td align="left"><tt>resources:resources</tt></td></tr><tr class="a"><td align="left"><tt>compile</tt></td><td align="left"><tt>compiler:compile</tt></td></tr><tr class="b"><td align="left"><tt>process-test-resources</tt></td><td align="left"><tt>resources:testResources</tt></td></tr><tr class="a"><td align="left"><tt>test-compile</tt></td><td align="left"><tt>compiler:testCompile</tt></td></tr><tr class="b"><td align="left"><tt>
 test</tt></td><td align="left"><tt>surefire:test</tt></td></tr><tr class="a"><td align="left"><tt>package</tt></td><td align="left"><tt>jar:jar</tt> <i>and</i> <tt>plugin:addPluginArtifactMetadata</tt></td></tr><tr class="b"><td align="left"><tt>install</tt></td><td align="left"><tt>install:install</tt> <i>and</i> <tt>plugin:updateRegistry</tt></td></tr><tr class="a"><td align="left"><tt>deploy</tt></td><td align="left"><tt>deploy:deploy</tt></td></tr></table></div><div class="section"><h4>Default Lifecycle Bindings - Packaging <tt>pom</tt><a name="Default_Lifecycle_Bindings_-_Packaging_pom"></a></h4><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>package</tt></td><td align="left"><tt>site:attach-descriptor</tt></td></tr><tr class="b"><td align="left"><tt>install</tt></td><td align="left"><tt>install:install</tt></td></tr><tr class="a"><td align="left"><tt>deploy</tt></td><td align="left"><tt>deploy:deploy</tt></td></tr></table></div><div class="sectio
 n"><h4>Site Lifecycle Bindings<a name="Site_Lifecycle_Bindings"></a></h4><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>site</tt></td><td align="left"><tt>site:site</tt></td></tr><tr class="b"><td align="left"><tt>site-deploy</tt></td><td align="left"><tt>site:deploy</tt></td></tr></table></div><div class="section"><h4>References<a name="References"></a></h4><p>The full Maven lifecycle is defined by the file <tt>components.xml</tt> in the module <tt>maven-core</tt> and viewable from SVN in the branches for <a class="externalLink" href="http://svn.apache.org/repos/asf/maven/maven-2/tags/maven-2.2.0/maven-core/src/main/resources/META-INF/plexus/components.xml">Maven 2.2.0</a> and <a class="externalLink" href="http://svn.apache.org/repos/asf/maven/maven-3/trunk/maven-core/src/main/resources/META-INF/plexus/components.xml">Maven 3.0.x</a>.</p><p><i><a href="./introduction-to-the-lifecycle.html">[top]</a>.</i></p></div></div></div>
+      </div>
+    </div>
+    <div class="clear">
+      <hr/>
+    </div>
+    <div id="footer">
+      <div class="xright">
+        &#169;            2002-2012
+              The Apache Software Foundation
+            
+                       - <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>.
+        Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation.
+      </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/maventest/trunk/content/guides/introduction/introduction-to-the-pom.html
==============================================================================
--- websites/staging/maventest/trunk/content/guides/introduction/introduction-to-the-pom.html (added)
+++ websites/staging/maventest/trunk/content/guides/introduction/introduction-to-the-pom.html Thu Mar  1 23:08:58 2012
@@ -0,0 +1,680 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- Generated by Apache Maven Doxia at Mar 1, 2012 -->
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Introduction to the POM</title>
+    <style type="text/css" media="all">
+      @import url("../../css/maven-base.css");
+      @import url("../../css/maven-theme.css");
+      @import url("../../css/site.css");
+    </style>
+    <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
+        <meta name="author" content="Jason van Zyl
+Franz Allan Valencia See
+Brett Porter" />
+        <meta name="Date-Creation-yyyymmdd" content="20090204" />
+    <meta name="Date-Revision-yyyymmdd" content="20120301" />
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+                                                    
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
+                                                        
+<script type="text/javascript">_uacct = "UA-140879-1";
+        urchinTracker();</script>
+                    </head>
+  <body class="composite">
+    <div id="banner">
+                                      <a href="../.././" id="bannerLeft">
+                                                <img src="../../images/apache-maven-project-2.png" alt="" />
+                </a>
+                        <span id="bannerRight">
+                                                <img src="../../images/maven-logo-2.gif" alt="" />
+                </span>
+            <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="breadcrumbs">
+            
+                                <div class="xleft">
+                          <a href="http://www.apache.org/" class="externalLink">Apache</a>
+        &gt;
+                  <a href="../../index.html">Maven</a>
+        &gt;
+    Introduction to the POM
+      </div>
+            <div class="xright">        
+                                 Last Published: 2012-03-01
+            </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="leftColumn">
+      <div id="navcolumn">
+             
+                                                <h5>Main</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../index.html">Welcome</a>
+            </li>
+          </ul>
+                       <h5>Get Maven</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../download.html">Download</a>
+            </li>
+                  <li class="none">
+                  <a href="../../docs/3.0.4/release-notes.html">Release Notes (3.0.4)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../docs/2.2.1/release-notes.html">Release Notes (2.2.1)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../docs/2.0.11/release-notes.html">Release Notes (2.0.11)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../license.html">License</a>
+            </li>
+          </ul>
+                       <h5>IDE Integration</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../eclipse-plugin.html">Eclipse</a>
+            </li>
+                  <li class="none">
+                  <a href="../../netbeans-module.html">NetBeans</a>
+            </li>
+          </ul>
+                       <h5>About Maven</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../what-is-maven.html">What is Maven?</a>
+            </li>
+                  <li class="none">
+                  <a href="../../maven-features.html">Features</a>
+            </li>
+                  <li class="none">
+                  <a href="../../general.html">FAQ (official)</a>
+            </li>
+                  <li class="none">
+                  <a href="http://docs.codehaus.org/display/MAVENUSER/FAQs-1" class="externalLink">FAQ (unofficial)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../powered-by-m2.html">Powered By</a>
+            </li>
+          </ul>
+                       <h5>Documentation</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../plugins/index.html">Maven Plugins</a>
+            </li>
+                  <li class="none">
+                  <a href="../../guides/index.html">Index (category)</a>
+            </li>
+                  <li class="none">
+                  <a href="../../run-maven/index.html">Running Maven</a>
+            </li>
+                                                                                                                                            <li class="collapsed">
+                  <a href="../../users/index.html">User Centre</a>
+                  </li>
+                                                                                                        <li class="collapsed">
+                  <a href="../../plugin-developers/index.html">Plugin Developer Centre</a>
+                  </li>
+                  <li class="none">
+                  <a href="../../repository/index.html">Maven Repository Centre</a>
+            </li>
+                  <li class="none">
+                  <a href="../../developers/index.html">Maven Developer Centre</a>
+            </li>
+                  <li class="none">
+                  <a href="../../articles.html">Books and Resources</a>
+            </li>
+                  <li class="none">
+                  <a href="http://docs.codehaus.org/display/MAVENUSER/Home" class="externalLink">Wiki</a>
+            </li>
+          </ul>
+                       <h5>Community</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../community.html">Community Overview</a>
+            </li>
+                  <li class="none">
+                  <a href="../../guides/development/guide-helping.html">How to Contribute</a>
+            </li>
+                  <li class="none">
+                  <a href="../../guides/mini/guide-maven-evangelism.html">Maven Repository</a>
+            </li>
+                  <li class="none">
+                  <a href="../../users/getting-help.html">Getting Help</a>
+            </li>
+                  <li class="none">
+                  <a href="../../issue-tracking.html">Issue Tracking</a>
+            </li>
+                  <li class="none">
+                  <a href="../../source-repository.html">Source Repository</a>
+            </li>
+                  <li class="none">
+                  <a href="../../team-list.html">The Maven Team</a>
+            </li>
+          </ul>
+                       <h5>Project Documentation</h5>
+                  <ul>
+                                                                                                                          <li class="collapsed">
+                  <a href="../../project-info.html">Project Information</a>
+                  </li>
+          </ul>
+                       <h5>Maven Projects</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="../../ant-tasks/index.html">Ant Tasks</a>
+            </li>
+                  <li class="none">
+                  <a href="../../archetype/index.html">Archetype</a>
+            </li>
+                  <li class="none">
+                  <a href="../../doxia/index.html">Doxia</a>
+            </li>
+                  <li class="none">
+                  <a href="../../jxr/index.html">JXR</a>
+            </li>
+                  <li class="none">
+                  <a href="../../maven-1.x/index.html">Maven 1.x</a>
+            </li>
+                  <li class="none">
+                  <a href="../../index.html">Maven 2 & 3</a>
+            </li>
+                  <li class="none">
+                  <a href="../../plugins/index.html">Plugins</a>
+            </li>
+                  <li class="none">
+                  <a href="../../scm/index.html">SCM</a>
+            </li>
+                  <li class="none">
+                  <a href="../../shared/index.html">Shared Components</a>
+            </li>
+                  <li class="none">
+                  <a href="../../surefire/index.html">Surefire</a>
+            </li>
+                  <li class="none">
+                  <a href="../../wagon/index.html">Wagon</a>
+            </li>
+          </ul>
+                       <h5>ASF</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink">How Apache Works</a>
+            </li>
+                  <li class="none">
+                  <a href="http://www.apache.org/foundation/" class="externalLink">Foundation</a>
+            </li>
+                  <li class="none">
+                  <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink">Sponsoring Apache</a>
+            </li>
+                  <li class="none">
+                  <a href="http://www.apache.org/foundation/thanks.html" class="externalLink">Thanks</a>
+            </li>
+          </ul>
+                                 <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+          <img alt="Built by Maven" src="../../images/logos/maven-feather.png"/>
+        </a>
+                       
+                            </div>
+    </div>
+    <div id="bodyColumn">
+      <div id="contentBox">
+        <div class="section"><h2>Introduction to the POM<a name="Introduction_to_the_POM"></a></h2><ul><li><a href="./introduction-to-the-pom.html#What_is_a_POM">What is a POM</a>?</li><li><a href="./introduction-to-the-pom.html#Super_POM">Super POM</a></li><li><a href="./introduction-to-the-pom.html#Minimal_POM">Minimal POM</a></li><li><a href="./introduction-to-the-pom.html#Project_Inheritance">Project Inheritance</a><ul><li><a href="./introduction-to-the-pom.html#Example_1">Example 1</a></li><li><a href="./introduction-to-the-pom.html#Example_2">Example 2</a></li></ul></li><li><a href="./introduction-to-the-pom.html#Project_Aggregation">Project Aggregation</a><ul><li><a href="./introduction-to-the-pom.html#Example_3">Example 3</a></li><li><a href="./introduction-to-the-pom.html#Example_4">Example 4</a></li></ul></li><li><a href="./introduction-to-the-pom.html#Project_Inheritance_vs_Project_Aggregation">Project Inheritance vs Project Aggregation</a><ul><li><a href="./intro
 duction-to-the-pom.html#Example_5">Example 5</a></li></ul></li><li><a href="./introduction-to-the-pom.html#Project_Interpolation">Project Interpolation and Expressions</a><ul><li><a href="./introduction-to-the-pom.html#Available_Variables">Available Variables</a></li></ul></li></ul><div class="section"><h3><a name="What_is_a_POM">What is a POM</a>?</h3><p>A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project. It contains default values for most projects. Examples for this is the build directory, which is <tt>target</tt>; the source directory, which is <tt>src/main/java</tt>; the test source directory, which is <tt>src/main/test</tt>; and so on.</p><p>The POM was renamed from <tt>project.xml</tt> in Maven 1 to <tt>pom.xml</tt> in Maven 2. Instead of having a <tt>maven.xml</tt> file that contains the goals that can be executed, the goals 
 or plugins are now configured in the <tt>pom.xml</tt>. When executing a task or goal, Maven looks for the POM in the current directory. It reads the POM, gets the needed configuration information, then executes the goal.</p><p>Some of the configuration that can be specified in the POM are the project dependencies, the plugins or goals that can be executed, the build profiles, and so on. Other information such as the project version, description, developers, mailing lists and such can also be specified.</p><p><a href="./introduction-to-the-pom.html">[top]</a></p></div><div class="section"><h3><a name="Super_POM">Super POM</a></h3><p>The Super POM is Maven's default POM. All POMs extend the Super POM unless explicitly set, meaning the configuration specified in the Super POM is inherited by the POMs you created for your projects. The snippet below is the Super POM for Maven 2.0.x.</p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;name&gt;Maven Default Project&lt;/name&gt;
+
+  &lt;repositories&gt;
+    &lt;repository&gt;
+      &lt;id&gt;central&lt;/id&gt;
+      &lt;name&gt;Maven Repository Switchboard&lt;/name&gt;
+      &lt;layout&gt;default&lt;/layout&gt;
+      &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
+      &lt;snapshots&gt;
+        &lt;enabled&gt;false&lt;/enabled&gt;
+      &lt;/snapshots&gt;
+    &lt;/repository&gt;
+  &lt;/repositories&gt;
+
+  &lt;pluginRepositories&gt;
+    &lt;pluginRepository&gt;
+      &lt;id&gt;central&lt;/id&gt;
+      &lt;name&gt;Maven Plugin Repository&lt;/name&gt;
+      &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
+      &lt;layout&gt;default&lt;/layout&gt;
+      &lt;snapshots&gt;
+        &lt;enabled&gt;false&lt;/enabled&gt;
+      &lt;/snapshots&gt;
+      &lt;releases&gt;
+        &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;
+      &lt;/releases&gt;
+    &lt;/pluginRepository&gt;
+  &lt;/pluginRepositories&gt;
+
+  &lt;build&gt;
+    &lt;directory&gt;target&lt;/directory&gt;
+    &lt;outputDirectory&gt;target/classes&lt;/outputDirectory&gt;
+    &lt;finalName&gt;${artifactId}-${version}&lt;/finalName&gt;
+    &lt;testOutputDirectory&gt;target/test-classes&lt;/testOutputDirectory&gt;
+    &lt;sourceDirectory&gt;src/main/java&lt;/sourceDirectory&gt;
+    &lt;scriptSourceDirectory&gt;src/main/scripts&lt;/scriptSourceDirectory&gt;
+    &lt;testSourceDirectory&gt;src/test/java&lt;/testSourceDirectory&gt;
+    &lt;resources&gt;
+      &lt;resource&gt;
+        &lt;directory&gt;src/main/resources&lt;/directory&gt;
+      &lt;/resource&gt;
+    &lt;/resources&gt;
+    &lt;testResources&gt;
+      &lt;testResource&gt;
+        &lt;directory&gt;src/test/resources&lt;/directory&gt;
+      &lt;/testResource&gt;
+    &lt;/testResources&gt;
+  &lt;/build&gt;
+
+  &lt;reporting&gt;
+    &lt;outputDirectory&gt;target/site&lt;/outputDirectory&gt;
+  &lt;/reporting&gt;
+
+  &lt;profiles&gt;
+    &lt;profile&gt;
+      &lt;id&gt;release-profile&lt;/id&gt;
+
+      &lt;activation&gt;
+        &lt;property&gt;
+          &lt;name&gt;performRelease&lt;/name&gt;
+        &lt;/property&gt;
+      &lt;/activation&gt;
+
+      &lt;build&gt;
+        &lt;plugins&gt;
+          &lt;plugin&gt;
+            &lt;inherited&gt;true&lt;/inherited&gt;
+            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+            &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
+
+            &lt;executions&gt;
+              &lt;execution&gt;
+                &lt;id&gt;attach-sources&lt;/id&gt;
+                &lt;goals&gt;
+                  &lt;goal&gt;jar&lt;/goal&gt;
+                &lt;/goals&gt;
+              &lt;/execution&gt;
+            &lt;/executions&gt;
+          &lt;/plugin&gt;
+          &lt;plugin&gt;
+            &lt;inherited&gt;true&lt;/inherited&gt;
+            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+            &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
+
+            &lt;executions&gt;
+              &lt;execution&gt;
+                &lt;id&gt;attach-javadocs&lt;/id&gt;
+                &lt;goals&gt;
+                  &lt;goal&gt;jar&lt;/goal&gt;
+                &lt;/goals&gt;
+              &lt;/execution&gt;
+            &lt;/executions&gt;
+          &lt;/plugin&gt;
+          &lt;plugin&gt;
+            &lt;inherited&gt;true&lt;/inherited&gt;
+            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+            &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
+
+            &lt;configuration&gt;
+              &lt;updateReleaseInfo&gt;true&lt;/updateReleaseInfo&gt;
+            &lt;/configuration&gt;
+          &lt;/plugin&gt;
+        &lt;/plugins&gt;
+      &lt;/build&gt;
+    &lt;/profile&gt;
+  &lt;/profiles&gt;
+
+&lt;/project&gt;
+</pre></div><p>The snippet below is the Super POM for Maven 2.1.x.</p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;name&gt;Maven Default Project&lt;/name&gt;
+
+  &lt;repositories&gt;
+    &lt;repository&gt;
+      &lt;id&gt;central&lt;/id&gt;
+      &lt;name&gt;Maven Repository Switchboard&lt;/name&gt;
+      &lt;layout&gt;default&lt;/layout&gt;
+      &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
+      &lt;snapshots&gt;
+        &lt;enabled&gt;false&lt;/enabled&gt;
+      &lt;/snapshots&gt;
+    &lt;/repository&gt;
+  &lt;/repositories&gt;
+
+  &lt;pluginRepositories&gt;
+    &lt;pluginRepository&gt;
+      &lt;id&gt;central&lt;/id&gt;
+      &lt;name&gt;Maven Plugin Repository&lt;/name&gt;
+      &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
+      &lt;layout&gt;default&lt;/layout&gt;
+      &lt;snapshots&gt;
+        &lt;enabled&gt;false&lt;/enabled&gt;
+      &lt;/snapshots&gt;
+      &lt;releases&gt;
+        &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;
+      &lt;/releases&gt;
+    &lt;/pluginRepository&gt;
+  &lt;/pluginRepositories&gt;
+
+  &lt;build&gt;
+    &lt;directory&gt;${project.basedir}/target&lt;/directory&gt;
+    &lt;outputDirectory&gt;${project.build.directory}/classes&lt;/outputDirectory&gt;
+    &lt;finalName&gt;${project.artifactId}-${project.version}&lt;/finalName&gt;
+    &lt;testOutputDirectory&gt;${project.build.directory}/test-classes&lt;/testOutputDirectory&gt;
+    &lt;sourceDirectory&gt;${project.basedir}/src/main/java&lt;/sourceDirectory&gt;
+    &lt;!-- TODO: MNG-3731 maven-plugin-tools-api &lt; 2.4.4 expect this to be relative... --&gt;
+    &lt;scriptSourceDirectory&gt;src/main/scripts&lt;/scriptSourceDirectory&gt;
+    &lt;testSourceDirectory&gt;${project.basedir}/src/test/java&lt;/testSourceDirectory&gt;
+    &lt;resources&gt;
+      &lt;resource&gt;
+        &lt;directory&gt;${project.basedir}/src/main/resources&lt;/directory&gt;
+      &lt;/resource&gt;
+    &lt;/resources&gt;
+    &lt;testResources&gt;
+      &lt;testResource&gt;
+        &lt;directory&gt;${project.basedir}/src/test/resources&lt;/directory&gt;
+      &lt;/testResource&gt;
+    &lt;/testResources&gt;
+   &lt;pluginManagement&gt;
+       &lt;plugins&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
+           &lt;version&gt;1.3&lt;/version&gt;
+         &lt;/plugin&gt;       
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.2-beta-2&lt;/version&gt;
+         &lt;/plugin&gt;         
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.2&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.0.2&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.0&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.4&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-ear-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.3.1&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-ejb-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.1&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-install-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.2&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.2&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.5&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-plugin-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.4.3&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-rar-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.2&lt;/version&gt;
+         &lt;/plugin&gt;        
+         &lt;plugin&gt;                
+           &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.0-beta-8&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;                
+           &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.3&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.0-beta-7&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.0.4&lt;/version&gt;
+         &lt;/plugin&gt;         
+         &lt;plugin&gt;
+            &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
+            &lt;version&gt;2.4.3&lt;/version&gt;
+         &lt;/plugin&gt;
+         &lt;plugin&gt;
+           &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
+           &lt;version&gt;2.1-alpha-2&lt;/version&gt;
+         &lt;/plugin&gt;
+       &lt;/plugins&gt;
+     &lt;/pluginManagement&gt;
+  &lt;/build&gt;
+
+  &lt;reporting&gt;
+    &lt;outputDirectory&gt;${project.build.directory}/site&lt;/outputDirectory&gt;
+  &lt;/reporting&gt;
+  &lt;profiles&gt;
+    &lt;profile&gt;
+      &lt;id&gt;release-profile&lt;/id&gt;
+
+      &lt;activation&gt;
+        &lt;property&gt;
+          &lt;name&gt;performRelease&lt;/name&gt;
+          &lt;value&gt;true&lt;/value&gt;
+        &lt;/property&gt;
+      &lt;/activation&gt;
+
+      &lt;build&gt;
+        &lt;plugins&gt;
+          &lt;plugin&gt;
+            &lt;inherited&gt;true&lt;/inherited&gt;
+            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+            &lt;artifactId&gt;maven-source-plugin&lt;/artifactId&gt;
+            &lt;executions&gt;
+              &lt;execution&gt;
+                &lt;id&gt;attach-sources&lt;/id&gt;
+                &lt;goals&gt;
+                  &lt;goal&gt;jar&lt;/goal&gt;
+                &lt;/goals&gt;
+              &lt;/execution&gt;
+            &lt;/executions&gt;
+          &lt;/plugin&gt;
+          &lt;plugin&gt;
+            &lt;inherited&gt;true&lt;/inherited&gt;
+            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+            &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
+            &lt;executions&gt;
+              &lt;execution&gt;
+                &lt;id&gt;attach-javadocs&lt;/id&gt;
+                &lt;goals&gt;
+                  &lt;goal&gt;jar&lt;/goal&gt;
+                &lt;/goals&gt;
+              &lt;/execution&gt;
+            &lt;/executions&gt;
+          &lt;/plugin&gt;
+          &lt;plugin&gt;
+            &lt;inherited&gt;true&lt;/inherited&gt;
+            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
+            &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
+            &lt;configuration&gt;
+              &lt;updateReleaseInfo&gt;true&lt;/updateReleaseInfo&gt;
+            &lt;/configuration&gt;
+          &lt;/plugin&gt;
+        &lt;/plugins&gt;
+      &lt;/build&gt;
+    &lt;/profile&gt;
+  &lt;/profiles&gt;
+
+&lt;/project&gt;
+</pre></div><p><a href="./introduction-to-the-pom.html">[top]</a></p></div><div class="section"><h3><a name="Minimal_POM">Minimal POM</a></h3><p>The minimum requirement for a POM are the following:</p><ul><li>project root</li><li>modelVersion - should be set to 4.0.0</li><li>groupId - the id of the project's group.</li><li>artifactId - the id of the artifact (project)</li><li>version - the version of the artifact under the specified group</li></ul><p>Here's an example:</p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+&lt;/project&gt;</pre></div><p>A POM requires that its groupId, artifactId, and version be configured. These three values form the project's fully qualified artifact name. This is in the form of &lt;groupId&gt;:&lt;artifactId&gt;:&lt;version&gt;. As for the example above, its fully qualified artifact name is &quot;com.mycompany.app:my-app:1&quot;.</p><p>Also, as mentioned in the <a href="#What_is_a_POM">first section</a>, if the configuration details are not specified, Maven will use their defaults. One of these default values is the packaging type. Every Maven project has a packaging type. If it is not specified in the POM, then the default value &quot;jar&quot; would be used.</p><p>Furthermore, as you can see that in the minimal POM, the <i>repositories</i> were not specified. If you build your project using the minimal POM, it would inherit the <i>repositories</i> configuration in the Super POM. Therefore when Maven sees the dependencies in the minimal POM, it would know 
 that these dependencies will be downloaded from <tt>http://repo1.maven.org/maven2</tt> which was specified in the Super POM.</p><p><a href="./introduction-to-the-pom.html">[top]</a></p></div><div class="section"><h3><a name="Project_Inheritance">Project Inheritance</a></h3><p>Elements in the POM that are merged are the following:</p><ul><li>dependencies</li><li>developers and contributors</li><li>plugin lists (including reports)</li><li>plugin executions with matching ids</li><li>plugin configuration</li><li>resources</li></ul><p>The Super POM is one example of project inheritance, however you can also introduce your own parent POMs by specifying the parent element in the POM, as demonstrated in the following examples.</p><div class="section"><h4><a name="Example_1">Example 1</a></h4><div class="section"><h5>The Scenario<a name="The_Scenario"></a></h5><p>As an example, let us reuse our previous artifact, com.mycompany.app:my-app:1. And let us introduce another artifact, com.
 mycompany.app:my-module:1.</p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-module&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+&lt;/project&gt;</pre></div><p>And let us specify their directory structure as the following:</p><div class="source"><pre>.
+ |-- my-module
+ |   `-- pom.xml
+ `-- pom.xml</pre></div><p><b>Note:</b> <tt>my-module/pom.xml</tt> is the POM of com.mycompany.app:my-module:1 while <tt>pom.xml</tt> is the POM of com.mycompany.app:my-app:1</p></div><div class="section"><h5>The Solution<a name="The_Solution"></a></h5><p>Now, if we were to turn com.mycompany.app:my-app:1 into a parent artifact of com.mycompany.app:my-module:1,we will have to modify com.mycompany.app:my-module:1's POM to the following configuration:</p><p><b>com.mycompany.app:my-module:1's POM</b></p><div class="source"><pre>&lt;project&gt;
+  &lt;parent&gt;
+    &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+    &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+    &lt;version&gt;1&lt;/version&gt;
+  &lt;/parent&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-module&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+&lt;/project&gt;</pre></div><p>Notice that we now have an added section, the parent section. This section allows us to specify which artifact is the parent of our POM. And we do so by specifying the fully qualified artifact name of the parent POM. With this setup, our module can now inherit some of the properties of our parent POM.</p><p>Alternatively, if we want the groupId and / or the version of your modules to be the same as their parents, you can remove the groupId and / or the version identity of your module in its POM.</p><div class="source"><pre>&lt;project&gt;
+  &lt;parent&gt;
+    &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+    &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+    &lt;version&gt;1&lt;/version&gt;
+  &lt;/parent&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;artifactId&gt;my-module&lt;/artifactId&gt;
+&lt;/project&gt;</pre></div><p>This allows the module to inherit the groupId and / or the version of its parent POM.</p><p><a href="./introduction-to-the-pom.html">[top]</a></p></div></div><div class="section"><h4><a name="Example_2">Example 2</a></h4><div class="section"><h5>The Scenario<a name="The_Scenario"></a></h5><p>However, that would work if the parent project was already installed in our local repository or was in that specific directory structure (parent <tt>pom.xml</tt> is one directory higher than that of the module's <tt>pom.xml</tt>).</p><p>But what if the parent is not yet installed and if the directory structure is</p><div class="source"><pre>.
+ |-- my-module
+ |   `-- pom.xml
+ `-- parent
+     `-- pom.xml</pre></div></div><div class="section"><h5>The Solution<a name="The_Solution"></a></h5><p>To address this directory structure (or any other directory structure), we would have to add the <tt>&lt;relativePath&gt;</tt> element to our parent section.</p><div class="source"><pre>&lt;project&gt;
+  &lt;parent&gt;
+    &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+    &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+    &lt;version&gt;1&lt;/version&gt;
+    &lt;relativePath&gt;.../parent/pom.xml&lt;/relativePath&gt;
+  &lt;/parent&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;artifactId&gt;my-module&lt;/artifactId&gt;
+&lt;/project&gt;</pre></div><p>As the name suggests, it's the relative path from the module's <tt>pom.xml</tt> to the parent's <tt>pom.xml</tt>.</p></div></div></div><div class="section"><h3><a name="Project_Aggregation">Project Aggregation</a></h3><p>Project Aggregation is similar to <a href="#Project_Inheritance">Project Inheritance</a>. But instead of specifying the parent POM from the module, it specifies the modules from the parent POM. By doing so, the parent project now knows its modules, and if a Maven command is invoked against the parent project, that Maven command will then be executed to the parent's modules as well. To do Project Aggregation, you must do the following:</p><ul><li>Change the parent POMs packaging to the value &quot;pom&quot; .</li><li>Specify in the parent POM the directories of its modules (children POMs)</li></ul><p><a href="./introduction-to-the-pom.html">[top]</a></p><div class="section"><h4><a name="Example_3">Example 3</a></h4><div class="s
 ection"><h5>The Scenario<a name="The_Scenario"></a></h5><p>Given the previous original artifact POMs, and directory structure,</p><p><b>com.mycompany.app:my-app:1's POM</b></p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+&lt;/project&gt;</pre></div><p><b>com.mycompany.app:my-module:1's POM</b></p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-module&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+&lt;/project&gt;</pre></div><p><b>directory structure</b></p><div class="source"><pre>.
+ |-- my-module
+ |   `-- pom.xml
+ `-- pom.xml</pre></div></div><div class="section"><h5>The Solution<a name="The_Solution"></a></h5><p>If we are to aggregate my-module into my-app, we would only have to modify my-app.</p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+  &lt;packaging&gt;pom&lt;/packaging&gt;
+
+  &lt;modules&gt;
+    &lt;module&gt;my-module&lt;/module&gt;
+  &lt;/modules&gt;
+&lt;/project&gt;</pre></div><p>In the revised com.mycompany.app:my-app:1, the packaging section and the modules sections were added. For the packaging, it's value was set to &quot;pom&quot;, and for the modules section, we have the element <tt>&lt;module&gt;my-module&lt;/module&gt;</tt>. The value of <tt>&lt;module&gt;</tt> is the relative path from the com.mycompany.app:my-app:1 to com.mycompany.app:my-module:1's POM (<i>by practice, we use the module's artifactId as the module directory's name</i>).</p><p>Now, whenever a Maven command processes com.mycompany.app:my-app:1, that same Maven command would be ran against com.mycompany.app:my-module:1 as well. Furthermore, some commands (goals specifically) handle project aggregation differently.</p><p><a href="./introduction-to-the-pom.html">[top]</a></p></div></div><div class="section"><h4><a name="Example_4">Example 4</a></h4><div class="section"><h5>The Scenario<a name="The_Scenario"></a></h5><p>But what if we change the dir
 ectory structure to the following:</p><div class="source"><pre>.
+ |-- my-module
+ |   `-- pom.xml
+ `-- parent
+     `-- pom.xml</pre></div><p>How would the parent pom specify its modules?</p></div><div class="section"><h5>The Solution<a name="The_Solution"></a></h5><p>The answer? - the same way as Example 3, by specifying the path to the module.</p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+  &lt;packaging&gt;pom&lt;/packaging&gt;
+
+  &lt;modules&gt;
+    &lt;module&gt;../my-module&lt;/module&gt;
+  &lt;/modules&gt;
+&lt;/project&gt;</pre></div></div></div></div><div class="section"><h3><a name="Project_Inheritance_vs_Project_Aggregation">Project Inheritance vs Project Aggregation</a></h3><p>If you have several Maven projects, and they all have similar configurations, you can refactor your projects by pulling out those similar configurations and making a parent project. Thus, all you have to do is to let your Maven projects inherit that parent project, and those configurations would then be applied to all of them.</p><p>And if you have a group of projects that are built or processed together, you can create a parent project and have that parent project declare those projects as its modules. By doing so, you'd only have to build the parent and the rest will follow.</p><p>But of course, you can have both Project Inheritance and Project Aggregation. Meaning, you can have your modules specify a parent project, and at the same time, have that parent project specify those Maven projects as its
  modules. You'd just have to apply all three rules:</p><ul><li>Specify in every child POM who their parent POM is.</li><li>Change the parent POMs packaging to the value &quot;pom&quot; .</li><li>Specify in the parent POM the directories of its modules (children POMs)</li></ul><p><a href="./introduction-to-the-pom.html">[top]</a></p><div class="section"><h4><a name="Example_5">Example 5</a></h4><div class="section"><h5>The Scenario<a name="The_Scenario"></a></h5><p>Given the previous original artifact POMs again,</p><p><b>com.mycompany.app:my-app:1's POM</b></p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+&lt;/project&gt;</pre></div><p><b>com.mycompany.app:my-module:1's POM</b></p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-module&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+&lt;/project&gt;</pre></div><p>and this <b>directory structure</b></p><div class="source"><pre>.
+ |-- my-module
+ |   `-- pom.xml
+ `-- parent
+     `-- pom.xml</pre></div></div><div class="section"><h5>The Solution<a name="The_Solution"></a></h5><p>To do both project inheritance and aggregation, you only have to apply all three rules.</p><p><b>com.mycompany.app:my-app:1's POM</b></p><div class="source"><pre>&lt;project&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+  &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+  &lt;version&gt;1&lt;/version&gt;
+  &lt;packaging&gt;pom&lt;/packaging&gt;
+
+  &lt;modules&gt;
+    &lt;module&gt;../my-module&lt;/module&gt;
+  &lt;/modules&gt;
+&lt;/project&gt;</pre></div><p><b>com.mycompany.app:my-module:1's POM</b></p><div class="source"><pre>&lt;project&gt;
+  &lt;parent&gt;
+    &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
+    &lt;artifactId&gt;my-app&lt;/artifactId&gt;
+    &lt;version&gt;1&lt;/version&gt;
+    &lt;relativePath&gt;../parent/pom.xml&lt;/relativePath&gt;
+  &lt;/parent&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  &lt;artifactId&gt;my-module&lt;/artifactId&gt;
+&lt;/project&gt;</pre></div><p><b>NOTE:</b> Profile inheritance the same inheritance strategy as used for the POM itself.</p><p><a href="./introduction-to-the-pom.html">[top]</a></p></div></div></div><div class="section"><h3><a name="Project_Interpolation">Project Interpolation</a> and Variables<a name="Project_Interpolation_and_Variables"></a></h3><p>One of the practices that Maven encourages is <i>don't repeat yourself</i>. However, there are circumstances where you will need to use the same value in several different locations. To assist in ensuring the value is only specified once, Maven allows you to use both your own and pre-defined variables in the POM.</p><p>For example, to access the <tt>project.version</tt> variable, you would reference it like so:</p><div class="source"><pre>  &lt;version&gt;${project.version}&lt;/version&gt;</pre></div><p>One factor to note is that these variables are processed <i>after</i> inheritance as outlined above. This means that if a pare
 nt project uses a variable, then its definition in the child, not the parent, will be the one eventually used.</p><div class="section"><h4><a name="Available_Variables">Available Variables</a></h4><div class="section"><h5>Project Model Variables<a name="Project_Model_Variables"></a></h5><p>Any field of the model that is a single value element can be referenced as a variable. For example, <tt>${project.groupId}</tt>, <tt>${project.version}</tt>, <tt>${project.build.sourceDirectory}</tt> and so on. Refer to the POM reference to see a full list of properties.</p><p>These variables are all referenced by the prefix &quot;<tt>project.</tt>&quot;. You may also see references with <tt>pom.</tt> as the prefix, or the prefix omitted entirely - these forms are now deprecated and should not be used.</p></div><div class="section"><h5>Special Variables<a name="Special_Variables"></a></h5><table border="1" class="bodyTable"><tr class="a"><td align="left"><tt>basedir</tt></td><td align="lef
 t">The directory that the current project resides in.</td></tr><tr class="b"><td align="left"><tt>project.baseUri</tt></td><td align="left">The directory that the current project resides in, represented as an URI. <i>Since Maven 2.1.0</i></td></tr><tr class="a"><td align="left"><tt>maven.build.timestamp</tt></td><td align="left">The timestamp that denotes the start of the build. <i>Since Maven 2.1.0-M1</i></td></tr></table><p>The format of the build timestamp can be customized by declaring the property <tt>maven.build.timestamp.format</tt> as shown in the example below:</p><div class="source"><pre>&lt;project&gt;
+  ...
+  &lt;properties&gt;
+    &lt;maven.build.timestamp.format&gt;yyyyMMdd-HHmm&lt;/maven.build.timestamp.format&gt;
+  &lt;/properties&gt;
+  ...
+&lt;/project&gt;</pre></div><p>The format pattern has to comply with the rules given in the API documentation for <a class="externalLink" href="http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a>. If the property is not present, the format defaults to the value already given in the example.</p></div><div class="section"><h5>Properties<a name="Properties"></a></h5><p>You are also able to reference any properties defined in the project as a variable. Consider the following example:</p><div class="source"><pre>&lt;project&gt;
+  ...
+  &lt;properties&gt;
+    &lt;mavenVersion&gt;2.1&lt;/mavenVersion&gt;
+  &lt;/properties&gt;
+  &lt;dependencies&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
+      &lt;artifactId&gt;maven-artifact&lt;/artifactId&gt;
+      &lt;version&gt;${mavenVersion}&lt;/version&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.maven&lt;/groupId&gt;
+      &lt;artifactId&gt;maven-project&lt;/artifactId&gt;
+      &lt;version&gt;${mavenVersion}&lt;/version&gt;
+    &lt;/dependency&gt;
+  &lt;/dependencies&gt;
+  ...
+&lt;/project&gt;</pre></div><p><a href="./introduction-to-the-pom.html">[top]</a></p></div></div></div></div>
+      </div>
+    </div>
+    <div class="clear">
+      <hr/>
+    </div>
+    <div id="footer">
+      <div class="xright">
+        &#169;            2002-2012
+              The Apache Software Foundation
+            
+                       - <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>.
+        Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation.
+      </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+  </body>
+</html>



Mime
View raw message