You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-commits@maven.apache.org by bu...@apache.org on 2014/07/11 07:10:39 UTC
svn commit: r915746 [6/13] - in /websites/staging/maven/trunk/content: ./
apache-resource-bundles/ archives/maven-2.x/ background/ developers/
developers/conventions/ developers/release/ developers/website/ docs/
docs/2.0.1/ docs/2.0.10/ docs/2.0.11/ d...
Modified: websites/staging/maven/trunk/content/guides/index.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/index.html (original)
+++ websites/staging/maven/trunk/content/guides/index.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Maven Documentation</title>
+ <title>Maven – Maven Documentation</title>
<style type="text/css" media="all">
@import url("../css/maven-base.css");
@import url("../css/maven-theme.css");
@@ -15,7 +15,7 @@
<meta name="author" content="Jason van Zyl
Eric Redmond" />
<meta name="Date-Creation-yyyymmdd" content="20090801" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -45,7 +45,7 @@ Eric Redmond" />
Maven Documentation
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -243,14 +243,14 @@ Eric Redmond" />
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed to the Apache Software Foundation (ASF) under one --><!-- or more contributor license agreements. See the NOTICE file --><!-- distributed with this work for additional information --><!-- regarding copyright ownership. The ASF licenses this file --><!-- to you 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>Documentation<a name="Documentation"></a></h2>
+<h2><a name="Documentation"></a>Documentation</h2>
<div class="section">
-<h3>Getting Started with Maven<a name="Getting_Started_with_Maven"></a></h3>
+<h3><a name="Getting_Started_with_Maven"></a>Getting Started with Maven</h3>
<ul>
<li><a href="./getting-started/maven-in-five-minutes.html">Getting Started in 5 Minutes</a></li>
<li><a href="./getting-started/index.html">Getting Started in 30 Minutes</a></li></ul></div>
<div class="section">
-<h3>Introductions<a name="Introductions"></a></h3>
+<h3><a name="Introductions"></a>Introductions</h3>
<ul>
<li><a href="./introduction/introduction-to-the-lifecycle.html">The Build Lifecycle</a></li>
<li><a href="./introduction/introduction-to-the-pom.html">The POM</a></li>
@@ -260,7 +260,7 @@ Eric Redmond" />
<li><a href="./introduction/introduction-to-dependency-mechanism.html">The Dependency Mechanism</a></li>
<li><a href="./introduction/introduction-to-optional-and-excludes-dependencies.html"> Optional Dependencies and Dependency Exclusions</a></li></ul>
<div class="section">
-<h4>Plugins<a name="Plugins"></a></h4>
+<h4><a name="Plugins"></a>Plugins</h4>
<ul>
<li><a href="./introduction/introduction-to-plugins.html">Plugin Development</a></li>
<li><a href="./mini/guide-configuring-plugins.html">Configuring Plug-ins</a></li>
@@ -270,31 +270,31 @@ Eric Redmond" />
<li><a href="./plugin/guide-ant-plugin-development.html">Developing Ant Plugins</a></li>
<li><a href="./plugin/guide-java-plugin-development.html">Developing Java Plugins</a></li></ul></div>
<div class="section">
-<h4>Site<a name="Site"></a></h4>
+<h4><a name="Site"></a>Site</h4>
<ul>
<li><a href="./mini/guide-site.html">Creating a Site</a></li>
<li><a class="externalLink" href="http://maven.apache.org/doxia/references/apt-format.html">The APT Format</a></li>
<li><a href="./mini/guide-snippet-macro.html">Snippet Macro</a></li></ul></div>
<div class="section">
-<h4>Archetypes<a name="Archetypes"></a></h4>
+<h4><a name="Archetypes"></a>Archetypes</h4>
<ul>
<li><a href="./introduction/introduction-to-archetypes.html">What is an Archetype</a></li>
<li><a href="./mini/guide-creating-archetypes.html">Creating Archetypes</a></li></ul></div>
<div class="section">
-<h4>Upgrading<a name="Upgrading"></a></h4>
+<h4><a name="Upgrading"></a>Upgrading</h4>
<ul>
<li><a href="./mini/guide-m1-m2.html">From Maven 1.x to Maven 2.x</a></li>
<li><a href="./mini/guide-using-m1-repos-with-m2.html">Using Maven 1.x repositories with Maven 2.x</a></li>
<li><a href="./mini/guide-relocation.html">Relocation of Artifacts</a></li></ul></div>
<div class="section">
-<h4>Repositories<a name="Repositories"></a></h4>
+<h4><a name="Repositories"></a>Repositories</h4>
<ul>
<li><a href="./mini/guide-3rd-party-jars-local.html">Installing 3rd party JARs to Local Repository</a></li>
<li><a href="./mini/guide-3rd-party-jars-remote.html">Deploying 3rd party JARs to Remote Repository</a></li>
<li><a href="./mini/guide-coping-with-sun-jars.html">Coping with Sun JARs</a></li>
<li><a href="./mini/guide-repository-ssl.html">Remote repository access through authenticated HTTPS</a></li></ul><!-- * {{{./introduction/introduction-to-artifact-resolution.html}Repository Definitions and Artifact Resolution}} --></div></div>
<div class="section">
-<h3>Guides<a name="Guides"></a></h3>
+<h3><a name="Guides"></a>Guides</h3>
<ul>
<li><a href="./mini/guide-assemblies.html">Creating Assemblies</a></li>
<li><a href="./mini/guide-archive-configuration.html">Configuring Archive Plugins</a></li>
@@ -320,21 +320,21 @@ Eric Redmond" />
<li><a href="./mini/guide-building-jdk14-on-jdk15.html"> Guide to Building JDK 1.4 Projects Using JDK 1.5</a></li>
<li><a href="./mini/guide-default-execution-ids.html"> Guide to Configuring Default Mojo Executions</a></li></ul><!-- ** Testing --><!-- * {{{./mini/guide-attached-tests.html}Reusable Test JARs}} -->
<div class="section">
-<h4>Maven Tools and IDE Integration<a name="Maven_Tools_and_IDE_Integration"></a></h4>
+<h4><a name="Maven_Tools_and_IDE_Integration"></a>Maven Tools and IDE Integration</h4>
<ul>
<li><a href="./mini/guide-ide-eclipse.html">Eclipse</a></li>
<li><a href="./mini/guide-ide-idea.html">IDEA</a></li>
<li><a href="./mini/guide-ide-netbeans/guide-ide-netbeans.html">NetBeans 4.0 (4.1 and 5.0)</a></li>
<li><a href="./mini/guide-bash-m2-completion.html">Maven 2.x Auto-Completion Using BASH</a></li></ul></div></div>
<div class="section">
-<h3>Development Guides<a name="Development_Guides"></a></h3>
+<h3><a name="Development_Guides"></a>Development Guides</h3>
<ul>
<li><a href="./development/guide-building-m2.html">Building Maven from Scratch</a></li>
<li><a href="./development/guide-m2-development.html">Developing Maven</a></li>
<li><a href="./development/guide-plugin-documentation.html">The Plugin Documentation Standard</a></li>
<li><a href="./development/guide-documentation-style.html">Maven Documentation Style</a></li></ul></div>
<div class="section">
-<h3>The Maven Community<a name="The_Maven_Community"></a></h3>
+<h3><a name="The_Maven_Community"></a>The Maven Community</h3>
<ul>
<li><a href="../community.html">The Maven Community</a></li>
<li><a href="./development/guide-helping.html">Helping with Maven</a></li>
@@ -342,18 +342,18 @@ Eric Redmond" />
<li><a href="./development/guide-testing-development-plugins.html">Testing Development Versions of Plugins</a></li>
<li><a href="../articles.html">3rd Party Resources</a></li></ul>
<div class="section">
-<h4>Conventions<a name="Conventions"></a></h4>
+<h4><a name="Conventions"></a>Conventions</h4>
<ul>
<li><a href="../maven-conventions.html">Maven Conventions</a></li>
<li><a href="./mini/guide-naming-conventions.html">Naming Conventions</a></li>
<li><a href="./mini/guide-using-one-source-directory.html">When You Can't Use the Conventions</a></li></ul></div>
<div class="section">
-<h4>The Central Repository<a name="The_Central_Repository"></a></h4>
+<h4><a name="The_Central_Repository"></a>The Central Repository</h4>
<ul>
<li><a href="./mini/guide-central-repository-upload.html">Uploading Artifacts to the Central Repository</a></li>
<li><a href="./mini/guide-maven-evangelism.html">Improving the Repository</a></li></ul></div></div>
<div class="section">
-<h3>References<a name="References"></a></h3>
+<h3><a name="References"></a>References</h3>
<ul>
<li><a href="../pom.html">POM Overview</a> (<a href="../ref/current/maven-model/maven.html">Technical Project Descriptor</a>)</li>
<li><a href="../settings.html">Settings Overview</a> (<a href="../ref/current/maven-settings/settings.html">Technical Settings Descriptor</a>)</li>
@@ -362,7 +362,7 @@ Eric Redmond" />
<li><a href="../glossary.html">Glossary</a></li>
<li><a href="./MavenQuickReferenceCard.pdf">Maven Quick Reference Card - PDF</a></li></ul></div>
<div class="section">
-<h3>Javadoc API<a name="Javadoc_API"></a></h3>
+<h3><a name="Javadoc_API"></a>Javadoc API</h3>
<p>Here is some useful Javadoc API links to the current version of Maven:</p>
<ul>
<li><a class="externalLink" href="http://maven.apache.org/ref/current/maven-artifact/apidocs/">Maven Artifact</a></li>
Modified: websites/staging/maven/trunk/content/guides/introduction/introduction-to-archetypes.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/introduction/introduction-to-archetypes.html (original)
+++ websites/staging/maven/trunk/content/guides/introduction/introduction-to-archetypes.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Introduction to Archetypes</title>
+ <title>Maven – Introduction to Archetypes</title>
<style type="text/css" media="all">
@import url("../../css/maven-base.css");
@import url("../../css/maven-theme.css");
@@ -14,7 +14,7 @@
<link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
<meta name="author" content="Jason van Zyl" />
<meta name="Date-Creation-yyyymmdd" content="20090826" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -44,7 +44,7 @@
Introduction to Archetypes
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -242,20 +242,20 @@
<div id="bodyColumn">
<div id="contentBox">
<div class="section">
-<h2>Introduction to Archetypes<a name="Introduction_to_Archetypes"></a></h2></div>
+<h2><a name="Introduction_to_Archetypes"></a>Introduction to Archetypes</h2></div>
<div class="section">
-<h2>What is Archetype?<a name="What_is_Archetype"></a></h2>
+<h2><a name="What_is_Archetype"></a>What is Archetype?</h2>
<p>In short, Archetype is a Maven project templating toolkit. An archetype is defined as <i>an original pattern or model from which all other things of the same kind are made</i>. The names fits as we are trying to provide a system that provides a consistent means of generating Maven projects. Archetype will help authors create Maven project templates for users, and provides users with the means to generate parameterized versions of those project templates.</p>
<p>Using archetypes provides a great way to enable developers quickly in a way consistent with best practices employed by your project or organization. Within the Maven project we use archetypes to try and get our users up and running as quickly as possible by providing a sample project that demonstrates many of the features of Maven while introducing new users to the best practices employed by Maven. In a matter of seconds a new user can have a working Maven project to use as a jumping board for investigating more of the features in Maven. We have also tried to make the Archetype mechanism additive and by that we mean allowing portions of a project to be captured in an archetype so that pieces or aspects of a project can be added to existing projects. A good example of this is the Maven site archetype. If, for example, you have used the quick start archetype to generate a working project you can then quickly create a site for that project by using the site archetype within that exi
sting project. You can do anything like this with archetypes.</p>
<p>You may want to standardize J2EE development within your organization so you may want to provide archetypes for EJBs, or WARs, or for your web services. Once these archetypes are created and deployed in your organization's repository they are available for use by all developers within your organization.</p>
<div class="section">
-<h3>Using an Archetype<a name="Using_an_Archetype"></a></h3>
+<h3><a name="Using_an_Archetype"></a>Using an Archetype</h3>
<p>To create a new project based on an Archetype, you need to call <tt>mvn archetype:generate</tt> goal, like the following:</p>
<div class="source">
<pre>mvn archetype:generate</pre></div>
<p>Please refer to <a class="externalLink" href="http://maven.apache.org/plugins/maven-archetype-plugin/usage.html">Archetype Plugin Page</a>.</p></div>
<div class="section">
-<h3>Provided Archetypes<a name="Provided_Archetypes"></a></h3>
+<h3><a name="Provided_Archetypes"></a>Provided Archetypes</h3>
<p>Maven provides several Archetype artifacts:</p>
<table border="1" class="bodyTable">
<tr class="a">
@@ -296,7 +296,7 @@
<td align="left">An archetype which contains a sample Maven Webapp project.</td></tr></table>
<p>For more information on these archetypes, please refer the <a class="externalLink" href="http://maven.apache.org/archetype/maven-archetype-bundles/">Maven Archetypes page</a>.</p></div>
<div class="section">
-<h3>What makes up an Archetype?<a name="What_makes_up_an_Archetype"></a></h3>
+<h3><a name="What_makes_up_an_Archetype"></a>What makes up an Archetype?</h3>
<p>Archetypes are packaged up in a JAR and they consist of the archetype metadata which describes the contents of archetype and a set of <a class="externalLink" href="http://velocity.apache.org/">Velocity</a> templates which make up the prototype project. If you would like to know how to make your own archetypes please refer to our <a href="../mini/guide-creating-archetypes.html">Guide to creating archetypes</a>.</p></div></div>
</div>
</div>
Modified: websites/staging/maven/trunk/content/guides/introduction/introduction-to-artifact-resolution.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/introduction/introduction-to-artifact-resolution.html (original)
+++ websites/staging/maven/trunk/content/guides/introduction/introduction-to-artifact-resolution.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Introduction to repository definitions and artifact resolution</title>
+ <title>Maven – Introduction to repository definitions and artifact resolution</title>
<style type="text/css" media="all">
@import url("../../css/maven-base.css");
@import url("../../css/maven-theme.css");
@@ -13,7 +13,7 @@
</style>
<link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
<meta name="author" content="John Casey" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -43,7 +43,7 @@
Introduction to repository definitions and artifact resolution
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -241,12 +241,12 @@
<div id="bodyColumn">
<div id="contentBox">
<div class="section">
-<h2>Introduction to Repository definitions and artifact resolution<a name="Introduction_to_Repository_definitions_and_artifact_resolution"></a></h2>
+<h2><a name="Introduction_to_Repository_definitions_and_artifact_resolution"></a>Introduction to Repository definitions and artifact resolution</h2>
<p>As you no doubt know by now, artifacts are a central concept to Maven. Since artifacts are referenced in abstract terms (groupId/artifactId rather than file path), they must be available in the Maven repository system in order for the build process to resolve them. This really amounts to putting the referenced artifacts into a Maven repository. </p>
<p>To promote flexibility in the configuration of your build environment, Maven allows multiple repositories to be defined from which artifacts can be resolved. Repositories are always defined in the POM, but since POMs can inherit from one another, and POM dependencies are resolved transitively, predicting which repository will be used to resolve a particular artifact can be daunting.</p>
<p>This document will attempt to explain the rules involved with constructing repository lists for resolving artifacts referenced in various parts of the build process, and eliminate - or at least, reduce - the potential for confusion when it comes to artifact resolution.</p>
<div class="section">
-<h3>Goals<a name="Goals"></a></h3>
+<h3><a name="Goals"></a>Goals</h3>
<p>The artifact resolution process in Maven has a couple of central goals which should help make the build process as flexible and powerful as possible. They are:</p>
<ul>
<li>Allow the local POM (the one being built) to have the first opportunity to control resolution.
Modified: websites/staging/maven/trunk/content/guides/introduction/introduction-to-dependency-mechanism.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/introduction/introduction-to-dependency-mechanism.html (original)
+++ websites/staging/maven/trunk/content/guides/introduction/introduction-to-dependency-mechanism.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Introduction to the Dependency Mechanism</title>
+ <title>Maven – Introduction to the Dependency Mechanism</title>
<style type="text/css" media="all">
@import url("../../css/maven-base.css");
@import url("../../css/maven-theme.css");
@@ -14,7 +14,7 @@
<link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
<meta name="author" content="Brett Porter
Trygve Laugstol" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -44,7 +44,7 @@ Trygve Laugstol" />
Introduction to the Dependency Mechanism
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -242,7 +242,7 @@ Trygve Laugstol" />
<div id="bodyColumn">
<div id="contentBox">
<div class="section">
-<h2>Introduction to the Dependency Mechanism<a name="Introduction_to_the_Dependency_Mechanism"></a></h2>
+<h2><a name="Introduction_to_the_Dependency_Mechanism"></a>Introduction to the Dependency Mechanism</h2>
<p>Dependency management is one of the features of Maven that is best known to users and is one of the areas where Maven excels. There is not much difficulty in managing dependencies for a single a project, but when you start getting into dealing with multi-module projects and applications that consist of tens or hundreds of modules this is where Maven can help you a great deal in maintaining a high degree of control and stability.</p>
<p>Learn more about:</p>
<ul>
Modified: websites/staging/maven/trunk/content/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/introduction/introduction-to-optional-and-excludes-dependencies.html (original)
+++ websites/staging/maven/trunk/content/guides/introduction/introduction-to-optional-and-excludes-dependencies.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Optional Dependencies and Dependency Exclusions</title>
+ <title>Maven – Optional Dependencies and Dependency Exclusions</title>
<style type="text/css" media="all">
@import url("../../css/maven-base.css");
@import url("../../css/maven-theme.css");
@@ -13,7 +13,7 @@
</style>
<link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
<meta name="author" content="Allan Ramirez" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -43,7 +43,7 @@
Optional Dependencies and Dependency Exclusions
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -241,17 +241,17 @@
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed to the Apache Software Foundation (ASF) under one --><!-- or more contributor license agreements. See the NOTICE file --><!-- distributed with this work for additional information --><!-- regarding copyright ownership. The ASF licenses this file --><!-- to you 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<a name="Introduction"></a></h2>
+<h2><a name="Introduction"></a>Introduction</h2>
<p>This section discusses the functionality of optional dependencies and dependency exclusions. This will help users to understand what are they, how to use them, how they work and when is the best way to use them. It also explains why exclusions are made as per dependency basis not in a POM level.</p>
<div class="section">
-<h3>Optional Dependencies<a name="Optional_Dependencies"></a></h3>
+<h3><a name="Optional_Dependencies"></a>Optional Dependencies</h3>
<p>Optional dependencies are used when it's not really possible (for whatever reason) to split a project up into sub-modules. The idea is that some of the dependencies are only used for certain features in the project, and will not be needed if that feature isn't used. Ideally, such a feature would be split into a sub-module that depended on the core functionality project...this new subproject would have only non-optional dependencies, since you'd need them all if you decided to use the subproject's functionality. </p>
<p>However, since the project cannot be split up (again, for whatever reason), these dependencies are declared optional. If a user wants to use functionality related to an optional dependency, they will have to redeclare that optional dependency in their own project. This is not the most clear way to handle this situation, but then again both optional dependencies and dependency exclusions are stop-gap solutions.</p>
<div class="section">
-<h4>Why use optional dependencies?<a name="Why_use_optional_dependencies"></a></h4>
+<h4><a name="Why_use_optional_dependencies"></a>Why use optional dependencies?</h4>
<p>It's not only important to declare optional dependencies in order to save space/memory/etc. It's vital to control the list of actual dependencies a person needs in order to use a project, since these jars may eventually make it into a WAR, EAR, EJB, etc. Inclusion of the wrong jars may violate a license agreement, cause classpath issues, etc. </p></div>
<div class="section">
-<h4>How do I use the optional tag?<a name="How_do_I_use_the_optional_tag"></a></h4>
+<h4><a name="How_do_I_use_the_optional_tag"></a>How do I use the optional tag?</h4>
<p>A dependency is declared as optional by simply setting the <optional> tag to true in your dependency declaration. See the sample below:</p>
<div class="source">
<pre>
@@ -270,7 +270,7 @@
</project>
</pre></div></div>
<div class="section">
-<h4>How do optional dependencies work?<a name="How_do_optional_dependencies_work"></a></h4>
+<h4><a name="How_do_optional_dependencies_work"></a>How do optional dependencies work?</h4>
<div class="source">
<pre>
Project-A -> Project-B
@@ -282,13 +282,13 @@ Project-X -> Project-A
</pre></div>
<p>But when another project(Project-X) declares Project-A as a dependency in its POM, the optional dependency takes effect. You'll notice that Project-B is not included in the classpath of Project-X; you will need to declare it directly in your POM in order for B to be included in X's classpath. </p></div>
<div class="section">
-<h4>Example<a name="Example"></a></h4>
+<h4><a name="Example"></a>Example</h4>
<p>Let us say that there is a project named <i>X2</i> that has similar functions with <i>Hibernate</i> which supports many database drivers/dependencies such as mysql, postgre, oracle etc. All of these dependencies are needed for X2 to build but not for your project, so it is very practical for X2 to declare these dependencies as optional, so that whenever your project declares X2 as a direct dependency in your POM, all the drivers supported by the X2 will not be automatically included to your project's classpath instead you'll have to declare it directly on what driver/dependency of the database you are going to use.</p></div></div>
<div class="section">
-<h3>Dependency Exclusions<a name="Dependency_Exclusions"></a></h3>
+<h3><a name="Dependency_Exclusions"></a>Dependency Exclusions</h3>
<p>Since maven 2.x resolves dependencies transitively, it is possible for unwanted dependencies to be included in your project's classpath. Projects that you depend on may not have declared their set of dependencies correctly, for example. In order to address this special situtation, maven 2.x has incorporated the notion of explicit dependency exclusion. Exclusions are set on a specific dependency in your POM, and are targeted at a specific groupId and artifactId. When you build your project, that artifact will not be added to your project's classpath <i>by way of the dependency in which the exclusion was declared</i>.</p>
<div class="section">
-<h4>How to use dependency exclusions<a name="How_to_use_dependency_exclusions"></a></h4>
+<h4><a name="How_to_use_dependency_exclusions"></a>How to use dependency exclusions</h4>
<p>We add the <exclusions> tag under the <dependency> section of the pom.</p>
<div class="source">
<pre>
@@ -311,7 +311,7 @@ Project-X -> Project-A
</project>
</pre></div></div>
<div class="section">
-<h4>How dependency exclusion works and when to use it <b>( as a last resort! )</b><a name="How_dependency_exclusion_works_and_when_to_use_it__as_a_last_resort_"></a></h4>
+<h4><a name="How_dependency_exclusion_works_and_when_to_use_it__as_a_last_resort_"></a>How dependency exclusion works and when to use it <b>( as a last resort! )</b></h4>
<div class="source">
<pre>
Project-A
@@ -408,7 +408,7 @@ Project-A
</project>
</pre></div></div>
<div class="section">
-<h4>Why exclusions are made on a per-dependency basis, rather than at the POM level<a name="Why_exclusions_are_made_on_a_per-dependency_basis_rather_than_at_the_POM_level"></a></h4>
+<h4><a name="Why_exclusions_are_made_on_a_per-dependency_basis_rather_than_at_the_POM_level"></a>Why exclusions are made on a per-dependency basis, rather than at the POM level</h4>
<p>This is mainly done to be sure the dependency graph is predictable, and to keep inheritance effects from excluding a dependency that should not be excluded. If you get to the method of last resort and have to put in an exclusion, you should be absolutely certain which of your dependencies is bringing in that unwanted transitive dependency.</p></div></div></div>
</div>
</div>
Modified: websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugin-prefix-mapping.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugin-prefix-mapping.html (original)
+++ websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugin-prefix-mapping.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Introduction to Plugin Prefix Resolution</title>
+ <title>Maven – Introduction to Plugin Prefix Resolution</title>
<style type="text/css" media="all">
@import url("../../css/maven-base.css");
@import url("../../css/maven-theme.css");
@@ -14,7 +14,7 @@
<link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
<meta name="author" content="John Casey" />
<meta name="Date-Creation-yyyymmdd" content="20090801" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -44,7 +44,7 @@
Introduction to Plugin Prefix Resolution
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -242,12 +242,12 @@
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed to the Apache Software Foundation (ASF) under one --><!-- or more contributor license agreements. See the NOTICE file --><!-- distributed with this work for additional information --><!-- regarding copyright ownership. The ASF licenses this file --><!-- to you 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 Plugin Prefix Resolution<a name="Introduction_to_Plugin_Prefix_Resolution"></a></h2>
+<h2><a name="Introduction_to_Plugin_Prefix_Resolution"></a>Introduction to Plugin Prefix Resolution</h2>
<p>When you execute Maven using a standard lifecycle phase, resolving the plugins that participate in that lifecycle is a relatively simple process. However, when you directly invoke a mojo from the command line, as in the case of <b>clean</b>, Maven must have some way of reliably resolving the <b>clean</b> plugin prefix to the <b>maven-clean-plugin</b>. This provides brevity for command-line invocations, while preserving the descriptiveness of the plugin's real artifactId.</p>
<p>To complicate matters even more, not all plugins should be forced to have the same groupId in the repository. Since groupIds are presumed to be controlled by one project, and multiple projects may release plugins for Maven, it follows that plugin-prefix mappings must also accommodate multiple plugin groupIds.</p>
<p>To address these concerns, Maven provides a new piece of repository-level metadata (not associated with any single artifact) for plugin groups, along with a plugin mapping manager to organize multiple plugin groups and provide search functionality.</p>
<div class="section">
-<h3>Specifying a Plugin's Prefix<a name="Specifying_a_Plugins_Prefix"></a></h3>
+<h3><a name="Specifying_a_Plugins_Prefix"></a>Specifying a Plugin's Prefix</h3>
<p>In order to give users a convenient prefix with which to reference your plugin a prefix must be associated with your plugin when it is built. By default, Maven will make a guess at the plugin-prefix to be used, by removing any instances of "maven" or "plugin" surrounded by dashes in the plugin's artifact ID. The conventional artifact ID formats to use are:</p>
<ul>
<li><tt>maven-${prefix}-plugin</tt> - for official plugins maintained by the Apache Maven team itself (you <b>must not</b> use this naming pattern for your plugin, see <a href="../plugin/guide-java-plugin-development.html#Plugin_Naming_Convention_and_Apache_Maven_Trademark">this note for more informations</a>)</li>
@@ -275,7 +275,7 @@
<div class="source">
<pre>mvn somePrefix:goal</pre></div></div>
<div class="section">
-<h3>Mapping Prefixes to Plugins<a name="Mapping_Prefixes_to_Plugins"></a></h3>
+<h3><a name="Mapping_Prefixes_to_Plugins"></a>Mapping Prefixes to Plugins</h3>
<p>For each groupId configured for searching, Maven will:</p>
<ol style="list-style-type: decimal">
<li>Download <tt>maven-metadata.xml</tt> from each remote repository into the local repository, and name it <tt>maven-metadata-${repoId}.xml</tt> within the path of ${groupId}.</li>
@@ -283,7 +283,7 @@
<li>Lookup the plugin prefix in the merged metadata. If it's mapped, it should refer to a concrete groupId-artifactId pair. Otherwise, go on to #1 for the next groupId in the user's plugin-groups.</li></ol>
<p>These metadata files consist of the <b>groupId</b> it represents (for clarity when the file is opened outside the context of the directory), and a group of <b>plugin</b> elements. Each <b>plugin</b> in this list contains a <b>prefix</b> element denoting the plugin's command-line prefix, and an <b>artifactId</b> element, which provides the other side of the prefix mapping and provides enough information to lookup and use the plugin. When a plugin is installed or deployed, the appropriate metadata file is located - and if the prefix mapping is missing - modified to include the plugin-prefix mapping.</p></div>
<div class="section">
-<h3>Configuring Maven to Search for Plugins<a name="Configuring_Maven_to_Search_for_Plugins"></a></h3>
+<h3><a name="Configuring_Maven_to_Search_for_Plugins"></a>Configuring Maven to Search for Plugins</h3>
<p>By default, Maven will search the groupId <b>org.apache.maven.plugins</b> for prefix-to-artifactId mappings for the plugins it needs to perform a given build. However, as previously mentioned, the user may have a need for third-party plugins. Since the Maven project is assumed to have control over the default plugin groupId, this means configuring Maven to search other groupId locations for plugin-prefix mappings.</p>
<p>As it turns out, this is simple. In the Maven settings file (per-user: <tt>~/.m2/settings.xml</tt>; global: <tt>$M2_HOME/conf/settings.xml</tt>), you can provide a custom <b>pluginGroups</b> section, listing the plugin groupIds you want to search (each groupId goes in its own <b>pluginGroup</b> sub-element). For example, if my project uses a Modello model file, I might have the following in my settings:</p>
<div class="source">
@@ -300,7 +300,7 @@
<p><b>NOTE:</b> When specifying plugin groups to be used in searching for a prefix mapping, order is critical! By specifying a pluginGroup of <tt>com.myco.plugins</tt> with a prefix of <tt>clean</tt>, I can override the usage of the <tt>maven-clean-plugin</tt> when <tt>clean:clean</tt> is invoked.</p>
<p><b>NOTE2:</b> For more information on <tt>settings.xml</tt>, see [<a href="#a1">1</a>].</p></div>
<div class="section">
-<h3>Resources<a name="Resources"></a></h3>
+<h3><a name="Resources"></a>Resources</h3>
<p><a name="a1">1</a> <a href="../mini/guide-configuring-maven.html">Guide to Configuring Maven</a></p></div></div>
</div>
</div>
Modified: websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugin-registry.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugin-registry.html (original)
+++ websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugin-registry.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Introduction to the Plugin Registry</title>
+ <title>Maven – Introduction to the Plugin Registry</title>
<style type="text/css" media="all">
@import url("../../css/maven-base.css");
@import url("../../css/maven-theme.css");
@@ -13,7 +13,7 @@
</style>
<link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
<meta name="author" content="John Casey" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -43,7 +43,7 @@
Introduction to the Plugin Registry
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -241,15 +241,15 @@
<div id="bodyColumn">
<div id="contentBox">
<div class="section">
-<h2>Introduction to the Plugin Registry<a name="Introduction_to_the_Plugin_Registry"></a></h2>
+<h2><a name="Introduction_to_the_Plugin_Registry"></a>Introduction to the Plugin Registry</h2>
<p>The Maven 2 plugin registry (~/.m2/plugin-registry.xml) is a mechanism to help the user exert some control over their build environment. Rather than simply fetching the latest version of every plugin used in a given build, this registry allows the user to peg a plugin to a particular version, and only update to newer versions under certain restricted circumstances. There are various ways to configure or bypass this feature, and the feature itself can be managed on either a per-user or global level.</p>
<div class="section">
-<h3><b>Warning!</b><a name="Warning"></a></h3>
+<h3><a name="Warning"></a><b>Warning!</b></h3>
<p>The plugin registry is currently in a semi-dormant state within Maven 2. This is because it has been shown to have some subtle behavior that is not quite intuitive. While we believe it's important to allow the user to pin down which version of a particular plugin is used across all builds, it's not clear that this type of information should be machine-specific (i.e. tied to something outside the project directory).</p>
<p>Users should be cautious when attempting to use the <tt>plugin-registry.xml</tt>. Redesign of this feature in upcoming 2.1 and/or 2.2 is likely.</p>
<p>For now, Maven <i>should</i> keep using the same version of a plugin - assuming a different version is not specified in the POM - until the user chooses to run with the <tt>-U</tt> option explicitly enabled.</p></div>
<div class="section">
-<h3>A Tour of plugin-registry.xml<a name="A_Tour_of_plugin-registry.xml"></a></h3>
+<h3><a name="A_Tour_of_plugin-registry.xml"></a>A Tour of plugin-registry.xml</h3>
<p>The plugin registry file (per-user: ~/.m2/plugin-registry.xml, global: $M2_HOME/conf/plugin-registry.xml) contains a set of plugin-version registrations, along with some configuration parameters for the registry itself.</p>
<p>Currently, the plugin registry supports configuration options for the following:</p>
<ul>
@@ -267,10 +267,10 @@
<li><b>useVersion</b> - The currently registered version for this plugin. This is the version Maven will use when executing this plugin's mojos.</li>
<li><b>rejectedVersions</b> - A list of versions discovered for this plugin which have been rejected by the user. This keeps Maven from continually prompting the user to update a given plugin to the same new version.</li></ul></div>
<div class="section">
-<h3>Using (or not) the Plugin Registry<a name="Using_or_not_the_Plugin_Registry"></a></h3>
+<h3><a name="Using_or_not_the_Plugin_Registry"></a>Using (or not) the Plugin Registry</h3>
<p>There are many ways you can override the default plugin registry settings. Often, this will be desirable for a single, one-off build of a project that deviates from your normal environment configuration. However, before discussing these options, it's important to understand how the plugin registry resolves versions for unregistered plugins, along with plugins in need of an update check.</p>
<div class="section">
-<h4>Resolving Plugin Versions<a name="Resolving_Plugin_Versions"></a></h4>
+<h4><a name="Resolving_Plugin_Versions"></a>Resolving Plugin Versions</h4>
<p>The plugin registry uses a relatively straightforward algorithm for resolving plugin versions. However, considerations for when to check, when to prompt the user, and when to persist resolved plugin versions complicate this implementation considerably. In general, plugin versions are resolved using a four-step process:</p>
<ol style="list-style-type: decimal">
<li>Check for a plugin configuration in the MavenProject instance. Any plugin configuration found in the MavenProject is treated as authoritative, and will stop the plugin-version resolution/persistence process when found.</li>
@@ -290,7 +290,7 @@
<li>Specify <b>usePluginRegistry</b> == <tt>false</tt> in the settings.xml. This configuration parameter will disable use of the plugin registry for the entire build environment, as opposed to the immediate build execution (as in the case of the corresponding command line switch above).
<p>These force all registered plugins to be updated. The user will still be prompted to approve plugin versions, unless one of the above switches is also provided.</p></li></ul></li></ol></div>
<div class="section">
-<h4>Summary of Command Line Options for the Plugin Registry<a name="Summary_of_Command_Line_Options_for_the_Plugin_Registry"></a></h4>
+<h4><a name="Summary_of_Command_Line_Options_for_the_Plugin_Registry"></a>Summary of Command Line Options for the Plugin Registry</h4>
<p>The following summary of command line options is provided for quick reference:</p>
<ul>
<li><tt>--no-plugin-registry</tt> - Bypass the plugin registry.
Modified: websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugin-resolution.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugin-resolution.html (original)
+++ websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugin-resolution.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Introduction to Maven Plugin Resolution</title>
+ <title>Maven – Introduction to Maven Plugin Resolution</title>
<style type="text/css" media="all">
@import url("../../css/maven-base.css");
@import url("../../css/maven-theme.css");
@@ -14,7 +14,7 @@
<link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
<meta name="author" content="John Casey" />
<meta name="Date-Creation-yyyymmdd" content="20090801" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -44,7 +44,7 @@
Introduction to Maven Plugin Resolution
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -242,13 +242,13 @@
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed to the Apache Software Foundation (ASF) under one --><!-- or more contributor license agreements. See the NOTICE file --><!-- distributed with this work for additional information --><!-- regarding copyright ownership. The ASF licenses this file --><!-- to you 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: How Maven Resolves Plugins<a name="Introduction:_How_Maven_Resolves_Plugins"></a></h2>
+<h2><a name="Introduction:_How_Maven_Resolves_Plugins"></a>Introduction: How Maven Resolves Plugins</h2>
<div class="section">
-<h3>Introduction<a name="Introduction"></a></h3>
+<h3><a name="Introduction"></a>Introduction</h3>
<p>Starting with 2.0, Maven allows users to execute plugins that have not yet been installed. This new feature eliminates the need to maintain local plugin installations, and provides the implicit ability to instantly take advantage of new plugin releases. However, it also means that plugin information must be resolved at build time, which can be a complex task.</p>
<p>This document will detail the mechanism used to resolve plugin information.</p></div>
<div class="section">
-<h3>Referencing Plugins<a name="Referencing_Plugins"></a></h3>
+<h3><a name="Referencing_Plugins"></a>Referencing Plugins</h3>
<p>Maven 2.0 brings with it added flexibility for referencing plugins and their mojos. Since plugin information is determined at build time, plugin prefixes can be ambiguous, and dependent on an individual user's Maven configuration. Therefore, in addition to the original mechanism of referencing a plugin by its shorthand prefix and a goal, Maven can also process plugin and mojo references that concretely specify groupId, artifactId, and optionally, version.</p>
<p>Most users will have little difficulty using Maven as before, referencing plugins by their prefix. However, with the introduction of the build lifecycle - and mojo bindings to that lifecycle - it is critical that lifecycle mappings be able to refer to a mojo in an unambiguous way. In fact, when dealing with lifecycle mappings, it's illegal to specify a mojo using its plugin-prefix. This helps Maven avoid the case where the 'jar' lifecycle behaves differently on two users' machines, simply due to their local Maven configurations. As a side effect of this requirement, users also have the option to specify plugins and mojos in this way from the command line.</p>
<p>For clarity, the following are the three ways to reference a mojo from the command line. These will all result in the clean mojo of the maven-clean-plugin being invoked:</p>
@@ -262,13 +262,13 @@
org.apache.maven.plugins:maven-clean-plugin:clean</pre></div>
<p><b>NOTE:</b> It's probably bad form to pin a plugin reference to a specific version inside a lifecycle mapping definition, since this prevents the user from taking advantage of plugin updates.</p></div>
<div class="section">
-<h3>Resolving Plugin Information<a name="Resolving_Plugin_Information"></a></h3>
+<h3><a name="Resolving_Plugin_Information"></a>Resolving Plugin Information</h3>
<p>Since users have the ability to reference a plugin by its groupId and artifactId <b>without</b> a version, Maven must have the ability to resolve the plugin's version given these other two attributes. However, since users can also refer to a plugin by its prefix, Maven must also have the ability to resolve a plugin by this prefix alone - including resolution of the plugin's version. To handle these two scenarios, Maven employs a two-stage process for resolving plugin information.</p>
<div class="section">
-<h4>Resolving <tt>groupId</tt> and <tt>artifactId</tt> for a Plugin<a name="Resolving_groupId_and_artifactId_for_a_Plugin"></a></h4>
+<h4><a name="Resolving_groupId_and_artifactId_for_a_Plugin"></a>Resolving <tt>groupId</tt> and <tt>artifactId</tt> for a Plugin</h4>
<p>Maven's approach to resolving a plugin's groupId and artifactId given its prefix is actually relatively simple. The user can specify a set of plugin groupId's to be searched. Using repository metadata for each configured groupId, Maven will search for plugin prefix mappings using the process detailed in [<a href="#a1">1</a>].</p></div>
<div class="section">
-<h4>Resolving a Plugin's Version<a name="Resolving_a_Plugins_Version"></a></h4>
+<h4><a name="Resolving_a_Plugins_Version"></a>Resolving a Plugin's Version</h4>
<p>When a plugin's groupId and artifactId are known, but its version is still unknown, Maven will resolve that plugin's version using a variety of sources. It will check, in order, the following:</p>
<ol style="list-style-type: decimal">
<li><i>the project's POM</i>
@@ -292,7 +292,7 @@
<p>Since the LATEST metadata is always published, it obsoletes this check when #3 is enabled. However, RELEASE metadata checking is still important in order to support legacy plugin-releases, where the LATEST metadata has not been published. This check can also be useful if the LATEST metadata check has been disabled. This might be used instead of LATEST metadata if the user only wants to use supported, released plugin versions.</p></li></ol>
<p>If all of the above resolution methods fail, the plugin cannot be located and an exception is thrown, stopping the build.</p></div></div>
<div class="section">
-<h3>Resources<a name="Resources"></a></h3>
+<h3><a name="Resources"></a>Resources</h3>
<p><a name="a1">1</a>. <a href="./introduction-to-plugin-prefix-mapping.html">Introduction to the Plugin Prefix Mapping</a>.</p>
<p><a name="a2">2</a>. <a href="./introduction-to-plugin-registry.html">Introduction to the Plugin Registry</a>.</p>
<p><a name="a3">3</a>. <a href="../mini/guide-configuring-maven.html">Guide to Configuring Maven</a></p></div></div>
Modified: websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugins.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugins.html (original)
+++ websites/staging/maven/trunk/content/guides/introduction/introduction-to-plugins.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Introduction to Maven 2.0 Plugin Development</title>
+ <title>Maven – Introduction to Maven 2.0 Plugin Development</title>
<style type="text/css" media="all">
@import url("../../css/maven-base.css");
@import url("../../css/maven-theme.css");
@@ -13,7 +13,7 @@
</style>
<link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
<meta name="author" content="John Casey" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -43,7 +43,7 @@
Introduction to Maven 2.0 Plugin Development
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -241,40 +241,40 @@
<div id="bodyColumn">
<div id="contentBox">
<!-- Licensed to the Apache Software Foundation (ASF) under one --><!-- or more contributor license agreements. See the NOTICE file --><!-- distributed with this work for additional information --><!-- regarding copyright ownership. The ASF licenses this file --><!-- to you 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 Maven 2.0 Plugin Development<a name="Introduction_to_Maven_2.0_Plugin_Development"></a></h2>
+<h2><a name="Introduction_to_Maven_2.0_Plugin_Development"></a>Introduction to Maven 2.0 Plugin Development</h2>
<p>Maven consists of a core engine which provides basic project-processing capabilities and build-process management, and a host of plugins which are used to execute the actual build tasks.</p>
<div class="section">
-<h3>What is a Plugin?<a name="What_is_a_Plugin"></a></h3>
+<h3><a name="What_is_a_Plugin"></a>What is a Plugin?</h3>
<p>"Maven" is really just a core framework for a collection of Maven Plugins. In other words, plugins are where much of the real action is performed, plugins are used to: create jar files, create war files, compile code, unit test code, create project documentation, and on and on. Almost any action that you can think of performing on a project is implemented as a Maven plugin.</p>
<p>Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects. They do this by executing an "action" (i.e. creating a WAR file or compiling unit tests) in the context of a project's description - the Project Object Model (POM). Plugin behavior can be customized through a set of unique parameters which are exposed by a description of each plugin goal (or Mojo).</p>
<p>One of the simplest plugins in Maven 2.0 is the Clean Plugin. The <a href="../../plugins/maven-clean-plugin/">Maven Clean plugin</a> (maven-clean-plugin) is responsible for removing the target directory of a Maven 2 project. When you run "mvn clean", Maven 2 executes the "clean" goal as defined in the Clean plug-in, and the target directory is removed. The Clean plugin <a href="../../plugins/maven-clean-plugin/clean-mojo.html">defines a parameter</a> which can be used to customize plugin behavior, this parameter is called outputDirectory and it defaults to ${project.build.directory}.</p></div>
<div class="section">
-<h3>What is a Mojo (<i>And Why the H--- is it Named 'Mojo'</i>)?<a name="What_is_a_Mojo_And_Why_the_H---_is_it_Named_Mojo"></a></h3>
+<h3><a name="What_is_a_Mojo_And_Why_the_H---_is_it_Named_Mojo"></a>What is a Mojo (<i>And Why the H--- is it Named 'Mojo'</i>)?</h3>
<p>A Mojo is really just a goal in Maven 2, and plug-ins consist of any number of goals (Mojos). Mojos can be defined as annotated Java classes or Beanshell script. A Mojo specifies metadata about a goal: a goal name, which phase of the lifecycle it fits into, and the parameters it is expecting.</p>
<p>MOJO is a play on POJO (Plain-old-Java-object), substituting "Maven" for "Plain". Mojo is also an iteresting word (see <a class="externalLink" href="http://www.answers.com/mojo&r=67">definition</a>). From <a class="externalLink" href="http://www.wikipedia.org">Wikipedia</a>, a "mojo" is defined as: "...a small bag worn by a person under the clothes (also known as a mojo hand). Such bags were thought to have supernatural powers, such as protecting from evil, bringing good luck, etc."</p></div>
<div class="section">
-<h3>What is the Build Lifecycle? (Overview)<a name="What_is_the_Build_Lifecycle_Overview"></a></h3>
+<h3><a name="What_is_the_Build_Lifecycle_Overview"></a>What is the Build Lifecycle? (Overview)</h3>
<p>The build lifecycle is a series of common stages through which all project builds naturally progress. Plugin goals are bound to specific stages in the lifecycle.</p></div></div>
<div class="section">
-<h2>Resources<a name="Resources"></a></h2>
+<h2><a name="Resources"></a>Resources</h2>
<ol style="list-style-type: decimal">
<li><a href="../plugin/guide-java-plugin-development.html">Plugin development guide</a></li>
<li><a href="../mini/guide-configuring-plugins.html">Configuring plugins</a></li></ol></div>
<div class="section">
-<h2>Comparison to Maven 1.x Plugins<a name="Comparison_to_Maven_1.x_Plugins"></a></h2>
+<h2><a name="Comparison_to_Maven_1.x_Plugins"></a>Comparison to Maven 1.x Plugins</h2>
<div class="section">
-<h3>Similarities to Maven 1.x<a name="Similarities_to_Maven_1.x"></a></h3>
+<h3><a name="Similarities_to_Maven_1.x"></a>Similarities to Maven 1.x</h3>
<p>Maven 2.0 is similar to its predecessor in that it has two main functions. First, it organizes project data into a coherent whole, and exposes this data for use within the build process. Second, Maven marshals a set of plugins to do the heavy lifting and execute the actual steps of the build.</p>
<p>Many things in Maven 2 will have at least superficial familiarity to users of Maven 1, and the plugin system is no exception. Maven 2 plugins appear to behave much as their 1.x counterparts do. Like 1.x plugins, they use both project information and custom-defined configurations to perform their work. Also, Maven 2 plugins are organized and executed in a coherent way by the build engine itself - that is to say, the engine is still responsible for organizing and fulfilling a plugin's requirements before executing the plugin itself.</p>
<p>Operationally, Maven 2.0 should feel very much like a more performant big brother of Maven 1.x. While the POM has definitely changed, it has the same basic layout and features (with notable additions). However, this is where the similarity ends. Maven 2.0 is a complete redesign and reimplementation of the Maven build concept. As such, it has a much different and more evolved architecture - at least to our minds. <b>;-)</b></p></div>
<div class="section">
-<h3>Differences from Maven 1.x<a name="Differences_from_Maven_1.x"></a></h3>
+<h3><a name="Differences_from_Maven_1.x"></a>Differences from Maven 1.x</h3>
<p>However similar the architectures may seem, Maven 2 offers a much richer environment for its plugins than Maven 1 ever did. The new architecture offers a managed lifecycle, multiple implementation languages, reusability outside of the build system, and many more advantages. Arguably the biggest advantage is the ability to write Maven plugins entirely in Java, which allows developers to tap into a rich landscape of development and testing tools to aid in their efforts.</p>
<p>Prior to Maven 2.0, the build system organized relevant plugins into a loosely defined lifecycle, which was determined based on goal prerequisites and decoration via preGoals and postGoals. That experience was critical for the Maven community. It taught us that even though there may be a million different build scenarios out there, most of the activities in those builds fit into just a few broad categories. Moreover, the category to which a goal fits serves as an accurate predictor for where in the build process the goal should execute. Drawing on this experience, Maven 2.0 defines a lifecycle within which plugins are managed according to their relative position within this lifecycle.</p>
<p>Starting with Maven 2.0, plugins implemented in different programming or scripting languages can coexist within the same build process. This removes the requirement that plugin developers learn a particular scripting language in order to interact with Maven. It also reduced the risk associated with the stability or richness of any particular scripting language.</p>
<p>Also starting with Maven 2.0 is an effort to integrate multiproject builds directly into the core architecture. In Maven 1.x, many large projects were fragmented into smaller builds to sidestep issues such as conditional compilation of a subset of classes; separation of client-server code; or cyclical dependencies between distinct application libraries. This in turn created extra complexity with running builds, since multiple builds had to be run in order to build the application as a whole - one or more per project. While the first version (1.x) did indeed address this new multiple projects issue, it did so as an afterthought. The Reactor was created to act as a sort of <i>apply-to-all-these</i> function, and the multiproject plugin was later added to provide Reactor settings for some common build types. However, this solution (it <i>is</i> really only one solution, plus some macros) really never integrated the idea of the multi-project build process into the maven core conceptu
al framework.</p></div>
<div class="section">
-<h3>Why Change the Plugin Architecture?<a name="Why_Change_the_Plugin_Architecture"></a></h3>
+<h3><a name="Why_Change_the_Plugin_Architecture"></a>Why Change the Plugin Architecture?</h3>
<p>See the previous section for the long version, but the short version can be summed up by the following list of benefits.</p>
<ul>
<li>A managed lifecycle</li>
Modified: websites/staging/maven/trunk/content/guides/introduction/introduction-to-profiles.html
==============================================================================
--- websites/staging/maven/trunk/content/guides/introduction/introduction-to-profiles.html (original)
+++ websites/staging/maven/trunk/content/guides/introduction/introduction-to-profiles.html Fri Jul 11 05:10:35 2014
@@ -1,11 +1,11 @@
<!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 2014-07-01
+ | Generated by Apache Maven Doxia at 2014-07-11
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Maven - Introduction to build profiles</title>
+ <title>Maven – Introduction to build profiles</title>
<style type="text/css" media="all">
@import url("../../css/maven-base.css");
@import url("../../css/maven-theme.css");
@@ -13,7 +13,7 @@
</style>
<link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
<meta name="author" content="January 2008" />
- <meta name="Date-Revision-yyyymmdd" content="20140701" />
+ <meta name="Date-Revision-yyyymmdd" content="20140711" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
@@ -43,7 +43,7 @@
Introduction to build profiles
</div>
<div class="xright">
- Last Published: 2014-07-01
+ Last Published: 2014-07-11
</div>
<div class="clear">
<hr/>
@@ -241,12 +241,12 @@
<div id="bodyColumn">
<div id="contentBox">
<div class="section">
-<h2>Introduction to Build Profiles<a name="Introduction_to_Build_Profiles"></a></h2>
+<h2><a name="Introduction_to_Build_Profiles"></a>Introduction to Build Profiles</h2>
<p>Apache Maven 2.0 goes to great lengths to ensure that builds are portable. Among other things, this means allowing build configuration inside the POM, avoiding <b>all</b> filesystem references (in inheritance, dependencies, and other places), and leaning much more heavily on the local repository to store the metadata needed to make this possible.</p>
<p>However, sometimes portability is not entirely possible. Under certain conditions, plugins may need to be configured with local filesystem paths. Under other circumstances, a slightly different dependency set will be required, and the project's artifact name may need to be adjusted slightly. And at still other times, you may even need to include a whole plugin in the build lifecycle depending on the detected build environment.</p>
<p>To address these circumstances, Maven 2.0 introduces the concept of a build profile. Profiles are specified using a subset of the elements available in the POM itself (plus one extra section), and are triggered in any of a variety of ways. They modify the POM at build time, and are meant to be used in complementary sets to give equivalent-but-different parameters for a set of target environments (providing, for example, the path of the appserver root in the development, testing, and production environments). As such, profiles can easily lead to differing build results from different members of your team. However, used properly, profiles can be used while still preserving project portability. This will also minimize the use of <tt>-f</tt> option of maven which allows user to create another POM with different parameters or configuration to build which makes it more maintainable since it is runnning with one POM only.</p>
<div class="section">
-<h3>What are the different types of profile? Where is each defined?<a name="What_are_the_different_types_of_profile_Where_is_each_defined"></a></h3>
+<h3><a name="What_are_the_different_types_of_profile_Where_is_each_defined"></a>What are the different types of profile? Where is each defined?</h3>
<ul>
<li>Per Project
<p>- Defined in the POM itself <tt>(pom.xml)</tt>.</p></li>
@@ -257,7 +257,7 @@
<li>Profile descriptor
<p>- a descriptor located in <a class="externalLink" href="http://maven.apache.org/ref/2.2.1/maven-profile/profiles.html">project basedir <tt>(profiles.xml)</tt></a> (unsupported in Maven 3.0: see <a class="externalLink" href="https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-profiles.xml"> Maven 3 compatibility notes</a>)</p></li></ul></div>
<div class="section">
-<h3>How can a profile be triggered? How does this vary according to the type of profile being used?<a name="How_can_a_profile_be_triggered_How_does_this_vary_according_to_the_type_of_profile_being_used"></a></h3>
+<h3><a name="How_can_a_profile_be_triggered_How_does_this_vary_according_to_the_type_of_profile_being_used"></a>How can a profile be triggered? How does this vary according to the type of profile being used?</h3>
<p>A profile can be triggered/activated in several ways:</p>
<ul>
<li>Explicitly</li>
@@ -266,7 +266,7 @@
<li>OS settings</li>
<li>Present or missing files</li></ul>
<div class="section">
-<h4>Details on profile activation<a name="Details_on_profile_activation"></a></h4>
+<h4><a name="Details_on_profile_activation"></a>Details on profile activation</h4>
<p>Profiles can be explicitly specified using the <tt>-P</tt> CLI option.</p>
<p>This option takes an argument that is a comma-delimited list of profile-ids to use. When this option is specified, no profiles other than those specified in the option argument will be activated.</p>
<div class="source">
@@ -374,21 +374,21 @@
</profiles></pre></div>
<p>This profile will automatically be active for all builds unless another profile in the same POM is activated using one of the previously described methods. All profiles that are active by default are automatically deactivated when a profile in the POM is activated on the command line or through its activation config.</p></div>
<div class="section">
-<h4>Deactivating a profile<a name="Deactivating_a_profile"></a></h4>
+<h4><a name="Deactivating_a_profile"></a>Deactivating a profile</h4>
<p>Starting with Maven 2.0.10, one or more profiles can be deactivated using the command line by prefixing their identifier with either the character '!' or '-' as shown below:</p>
<div class="source">
<pre>mvn groupId:artifactId:goal -P !profile-1,!profile-2</pre></div>
<p>This can be used to deactivate profiles marked as activeByDefault or profiles that would otherwise be activated through their activation config.</p></div></div>
<div class="section">
-<h3>Which areas of a POM can be customized by each type of profile? Why?<a name="Which_areas_of_a_POM_can_be_customized_by_each_type_of_profile_Why"></a></h3>
+<h3><a name="Which_areas_of_a_POM_can_be_customized_by_each_type_of_profile_Why"></a>Which areas of a POM can be customized by each type of profile? Why?</h3>
<p>Now that we've talked about where to specify profiles, and how to activate them, it will be useful to talk about <i>what</i> you can specify in a profile. As with the other aspects of profile configuration, this answer is not straightforward.</p>
<p>Depending on where you choose to configure your profile, you will have access to varying POM configuration options.</p>
<div class="section">
-<h4>Profiles in external files<a name="Profiles_in_external_files"></a></h4>
+<h4><a name="Profiles_in_external_files"></a>Profiles in external files</h4>
<p>Profiles specified in external files (i.e in <tt>settings.xml</tt> or <tt>profiles.xml</tt>) are not portable in the strictest sense. Anything that seems to stand a high chance of changing the result of the build is restricted to the inline profiles in the POM. Things like repository lists could simply be a proprietary repository of approved artifacts, and won't change the outcome of the build. Therefore, you will only be able to modify the <tt><repositories></tt> and <tt><pluginRepositories></tt> sections, plus an extra <tt><properties></tt> section.</p>
<p>The <tt><properties></tt> section allows you to specify free-form key-value pairs which will be included in the interpolation process for the POM. This allows you to specify a plugin configuration in the form of <tt>${profile.provided.path}</tt>.</p></div>
<div class="section">
-<h4>Profiles in POMs<a name="Profiles_in_POMs"></a></h4>
+<h4><a name="Profiles_in_POMs"></a>Profiles in POMs</h4>
<p>On the other hand, if your profiles can be reasonably specified <i>inside</i> the POM, you have many more options. The trade-off, of course, is that you can only modify <i>that</i> project and it's sub-modules. Since these profiles are specified inline, and therefore have a better chance of preserving portability, it's reasonable to say you can add more information to them without the risk of that information being unavailable to other users.</p>
<p>Profiles specified in the POM can modify the following POM elements:</p>
<ul>
@@ -408,15 +408,15 @@
<li><tt><testResources></tt></li>
<li><tt><finalName></tt></li></ul></li></ul></div>
<div class="section">
-<h4>POM elements outside <profiles><a name="POM_elements_outside_profiles"></a></h4>
+<h4><a name="POM_elements_outside_profiles"></a>POM elements outside <profiles></h4>
<p>We don't allow modification of some POM elements outside of POM-profiles because these runtime modifications will not be distributed when the POM is deployed to the repository system, making that person's build of that project completely unique from others. While you can do this to some extent with the options given for external profiles, the danger is limited. Another reason is that this POM info is sometimes being reused from the parent POM.</p>
<p>External files such as <tt>settings.xml</tt> and <tt>profiles.xml</tt> also does not support elements outside the POM-profiles. Let us take this scenario for elaboration. When the effective POM get deployed to a remote repository, any person can pickup its info out of the repository and use it to build a Maven project directly. Now, imagine that if we can set profiles in dependencies, which is very important to a build, or in any other elements outside POM-profiles in <tt>settings.xml</tt> then most probably we cannot expect someone else to use that POM from the repository and be able to build it. And we have to also think about how to share the <tt>settings.xml</tt> with others. Note that too many files to configure is very confusing and very hard to maintain. Bottom line is that since this is build data, it should be in the POM. One of the goals in Maven 2 is to consolidate all the information needed to run a build into a single file, or file hierarchy which is the POM.</p></di
v></div>
<div class="section">
-<h3>Profile Pitfalls<a name="Profile_Pitfalls"></a></h3>
+<h3><a name="Profile_Pitfalls"></a>Profile Pitfalls</h3>
<p>We've already mentioned the fact that adding profiles to your build has the potential to break portability for your project. We've even gone so far as to highlight circumstances where profiles are likely to break project portability. However, it's worth reiterating those points as part of a more coherent discussion about some pitfalls to avoid when using profiles.</p>
<p>There are two main problem areas to keep in mind when using profiles. First are external properties, usually used in plugin configurations. These pose the risk of breaking portability in your project. The other, more subtle area is the incomplete specification of a natural set of profiles.</p>
<div class="section">
-<h4>External Properties<a name="External_Properties"></a></h4>
+<h4><a name="External_Properties"></a>External Properties</h4>
<p>External property definition concerns any property value defined outside the <tt>pom.xml</tt> but not defined in a corresponding profile inside it. The most obvious usage of properties in the POM is in plugin configuration. While it is certainly possible to break project portability without properties, these critters can have subtle effects that cause builds to fail. For example, specifying appserver paths in a profile that is specified in the <tt>settings.xml</tt> may cause your integration test plugin to fail when another user on the team attempts to build without a similar <tt>settings.xml</tt>. Consider the following <tt>pom.xml</tt> snippet for a web application project:</p>
<div class="source">
<pre><project>
@@ -459,7 +459,7 @@
<p>Congratulations, your project is now non-portable. Inlining this profile in your <tt>pom.xml</tt> can help alleviate this, with the obvious drawback that each project hierarchy (allowing for the effects of inheritance) now have to specify this information. Since Maven provides good support for project inheritance, it's possible to stick this sort of configuration in the <tt><pluginManagement></tt> section of a team-level POM or similar, and simply inherit the paths.</p>
<p>Another, less attractive answer might be standardization of development environments. However, this will tend to compromise the productivity gain that Maven is capable of providing.</p></div>
<div class="section">
-<h4>Incomplete Specification of a Natural Profile Set<a name="Incomplete_Specification_of_a_Natural_Profile_Set"></a></h4>
+<h4><a name="Incomplete_Specification_of_a_Natural_Profile_Set"></a>Incomplete Specification of a Natural Profile Set</h4>
<p>In addition to the above portability-breaker, it's easy to fail to cover all cases with your profiles. When you do this, you're usually leaving one of your target environments high and dry. Let's take the example <tt>pom.xml</tt> snippet from above one more time:</p>
<div class="source">
<pre><project>
@@ -524,7 +524,7 @@
<p>will not do a successful build. Why? Because, the resulting non-interpolated literal value of <tt>${appserver.home}</tt> will not be a valid path for deploying and testing your web application. We haven't considered the case for the production environment when writing our profiles. The "production" environment (env=production), along with "test" and possibly even "local" constitute a natural set of target environments for which we may want to build the integration-test lifecycle phase. The incomplete specification of this natural set means we have effectively limited our valid target environments to the development environment. Your teammates - and probably your manager - will not see the humor in this. When you construct profiles to handle cases such as these, be sure to address the entire set of target permutations.</p>
<p>As a quick aside, it's possible for user-specific profiles to act in a similar way. This means that profiles for handling different environments which are keyed to the user can act up when the team adds a new developer. While I suppose this <i>could</i> act as useful training for the newbie, it just wouldn't be nice to throw them to the wolves in this way. Again, be sure to think of the <i>whole</i> set of profiles.</p></div></div>
<div class="section">
-<h3>How can I tell which profiles are in effect during a build?<a name="How_can_I_tell_which_profiles_are_in_effect_during_a_build"></a></h3>
+<h3><a name="How_can_I_tell_which_profiles_are_in_effect_during_a_build"></a>How can I tell which profiles are in effect during a build?</h3>
<p>Determining active profiles will help the user to know what particular profiles has been executed during a build. We can use the <a class="externalLink" href="http://maven.apache.org/plugins/maven-help-plugin/">Maven Help Plugin</a> to tell what profiles are in effect during a build.</p>
<div class="source">
<pre> mvn help:active-profiles</pre></div>
@@ -561,7 +561,7 @@
<p>This will print the effective POM for this build configuration out to the console. Take note that profiles in the <tt>settings.xml</tt> takes higher priority than profiles in the POM. So the profile that has been applied here is <tt>appserverConfig</tt> not <tt>appserverConfig-dev</tt>.</p>
<p>If you want to redirect the output from the plugin to a file called <tt>effective-pom.xml</tt>, use the command-line option <tt>-Doutput=effective-pom.xml</tt>.</p></div>
<div class="section">
-<h3>Naming Conventions<a name="Naming_Conventions"></a></h3>
+<h3><a name="Naming_Conventions"></a>Naming Conventions</h3>
<p>By now you've noticed that profiles are a natural way of addressing the problem of different build configuration requirements for different target environments. Above, we discussed the concept of a "natural set" of profiles to address this situation, and the importance of considering the whole set of profiles that will be required.</p>
<p>However, the question of how to organize and manage the evolution of that set is non-trivial as well. Just as a good developer strives to write self-documenting code, it's important that your profile id's give a hint to their intended use. One good way to do this is to use the common system property trigger as part of the name for the profile. This might result in names like <b>env-dev</b>, <b>env-test</b>, and <b>env-prod</b> for profiles that are triggered by the system property <b>env</b>. Such a system leaves a highly intuitive hint on how to activate a build targeted at a particular environment. Thus, to activate a build for the test environment, you need to activate <b>env-test</b> by issuing:</p>
<div class="source">