Quantcast

svn commit: r806981 [22/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....

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svn commit: r806981 [22/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....

buildbot
Added: websites/staging/maventest/trunk/content/guides/introduction/introduction-to-profiles.html
==============================================================================
--- websites/staging/maventest/trunk/content/guides/introduction/introduction-to-profiles.html (added)
+++ websites/staging/maventest/trunk/content/guides/introduction/introduction-to-profiles.html Thu Mar  1 23:08:58 2012
@@ -0,0 +1,393 @@
+<!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 build profiles</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="January 2008" />
+        <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 build profiles
+      </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 Build Profiles<a name="Introduction_to_Build_Profiles"></a></h2><p>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. Pro
 files 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><ul><li>Per Project<p>- Defined in the POM itself <tt>(pom.xml)</tt>.</p></li><li>Per User<p>- Defined in the <a class="externalLink" href="http://maven.apache.org/ref/2.2.1/maven-settings/settings.html"> Maven-settings</a> <tt>(%USER_HOME%/.m2/settings.xml)</tt>.</p></li><li>Global<p>- Defined in the <a class="externalLink" href="http://maven.apache.org/ref/2.2.1/maven-settings/settings.html"> global Maven-settings</a> <tt>(%M2_HOME%/conf/settings.xml)</tt>.</p></li><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><p>A profile can be triggered/activated in several ways:</p><ul><li>Explicitly</li><li>Through Maven settings</li><li>Based on environment variables</li><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><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"><pre>mvn groupId:artifactId:goal -P profile-1,profile-2</pre></div><p>Profiles can be activated in the Maven settings, via the <tt>&lt;activeProfiles&gt;</tt> section. This section takes a list of <tt>&lt;activeProfile&gt;</tt>
 elements, each containing a profile-id inside.</p><div class="source"><pre>&lt;settings&gt;
+  ...
+  &lt;activeProfiles&gt;
+    &lt;activeProfile&gt;profile-1&lt;/activeProfile&gt;
+  &lt;/activeProfiles&gt;
+  ...
+&lt;/settings&gt;</pre></div><p>Profiles listed in the <tt>&lt;activeProfiles&gt;</tt> tag would be activated by default every time a project use it.</p><p>Profiles can be automatically triggered based on the detected state of the build environment. These triggers are specified via an <tt>&lt;activation&gt;</tt> section in the profile itself. Currently, this detection is limited to prefix-matching of the JDK version, the presence of a system property or the value of a system property. Here are some examples.</p><p>The following configuration will trigger the profile when the JDK's version starts with &quot;1.4&quot; (eg. &quot;1.4.0_08&quot;, &quot;1.4.2_07&quot;, &quot;1.4&quot;):</p><div class="source"><pre>&lt;profiles&gt;
+  &lt;profile&gt;
+    &lt;activation&gt;
+      &lt;jdk&gt;1.4&lt;/jdk&gt;
+    &lt;/activation&gt;
+    ...
+  &lt;/profile&gt;
+&lt;/profiles&gt;</pre></div><p>Ranges can also be used as of Maven 2.1 (refer to the <a class="externalLink" href="http://maven.apache.org/enforcer/enforcer-rules/versionRanges.html"> Enforcer Version Range Syntax</a> for more information). The following honours versions 1.3, 1.4 and 1.5.</p><div class="source"><pre>&lt;profiles&gt;
+  &lt;profile&gt;
+    &lt;activation&gt;
+      &lt;jdk&gt;[1.3,1.6)&lt;/jdk&gt;
+    &lt;/activation&gt;
+    ...
+  &lt;/profile&gt;
+&lt;/profiles&gt;</pre></div><p><i>Note:</i> an upper bound such as <tt>,1.5]</tt> is likely not to include most releases of 1.5, since they will have an additional &quot;patch&quot; release such as <tt>_05</tt> that is not taken into consideration in the above range.</p><p>This next one will activate based on OS settings. See the <a class="externalLink" href="http://maven.apache.org/plugins/maven-enforcer-plugin/rules/requireOS.html">Maven Enforcer Plugin</a> for more details about OS values.</p><div class="source"><pre>&lt;profiles&gt;
+  &lt;profile&gt;
+    &lt;activation&gt;
+      &lt;os&gt;
+        &lt;name&gt;Windows XP&lt;/name&gt;
+        &lt;family&gt;Windows&lt;/family&gt;
+        &lt;arch&gt;x86&lt;/arch&gt;
+        &lt;version&gt;5.1.2600&lt;/version&gt;
+      &lt;/os&gt;
+    &lt;/activation&gt;
+    ...
+  &lt;/profile&gt;
+&lt;/profiles&gt;</pre></div><p>The profile below will activate the profile when the system property &quot;debug&quot; is specified with any value:</p><div class="source"><pre>&lt;profiles&gt;
+  &lt;profile&gt;
+    &lt;activation&gt;
+      &lt;property&gt;
+        &lt;name&gt;debug&lt;/name&gt;
+      &lt;/property&gt;
+    &lt;/activation&gt;
+    ...
+  &lt;/profile&gt;
+&lt;/profiles&gt;</pre></div><p>The next example will trigger the profile when the system property &quot;environment&quot; is specified with the value &quot;test&quot;:</p><div class="source"><pre>&lt;profiles&gt;
+  &lt;profile&gt;
+    &lt;activation&gt;
+      &lt;property&gt;
+        &lt;name&gt;environment&lt;/name&gt;
+        &lt;value&gt;test&lt;/value&gt;
+      &lt;/property&gt;
+    &lt;/activation&gt;
+    ...
+  &lt;/profile&gt;
+&lt;/profiles&gt;</pre></div><p>To activate this you would type this on the command line:</p><div class="source"><pre>mvn groupId:artifactId:goal -Denvironment=test</pre></div><p>As of Maven 3.0, profiles in the POM can also be activated based on properties from active profiles from the <tt>settings.xml</tt>.</p><p><b>Note</b>: Environment variables like <tt>FOO</tt> are available as properties of the form <tt>env.FOO</tt>. Further note that environment variable names are normalized to all upper-case on Windows.</p><p>This example will trigger the profile when the generated file <tt>target/generated-sources/axistools/wsdl2java/org/apache/maven</tt> is missing.</p><div class="source"><pre>&lt;profiles&gt;
+  &lt;profile&gt;
+    &lt;activation&gt;
+      &lt;file&gt;
+        &lt;missing&gt;target/generated-sources/axistools/wsdl2java/org/apache/maven&lt;/missing&gt;
+      &lt;/file&gt;
+    &lt;/activation&gt;
+    ...
+  &lt;/profile&gt;
+&lt;/profiles&gt;</pre></div><p>As of Maven 2.0.9, the tags <tt>&lt;exists&gt;</tt> and <tt>&lt;missing&gt;</tt> could be interpolated. Supported variables are system properties like <tt>${user.home}</tt> and environment variables like <tt>${env.HOME}</tt>. Please note that properties and values defined in the POM itself are not available for interpolation here, e.g. the above example activator cannot use <tt>${project.build.directory}</tt> but needs to hard-code the path <tt>target</tt>.</p><p>Profiles can also be active by default using a configuration like the following:</p><div class="source"><pre>&lt;profiles&gt;
+  &lt;profile&gt;
+    &lt;id&gt;profile-1&lt;/id&gt;
+    &lt;activation&gt;
+      &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
+    &lt;/activation&gt;
+    ...
+  &lt;/profile&gt;
+&lt;/profiles&gt;</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><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><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><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 <t
 t>&lt;repositories&gt;</tt> and <tt>&lt;pluginRepositories&gt;</tt> sections, plus an extra <tt>&lt;properties&gt;</tt> section.</p><p>The <tt>&lt;properties&gt;</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><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><li><tt>&lt;repositories&gt;</tt></li><li><tt>&lt;pluginRepositories&gt;</tt></li><li><tt>&lt;dependencies&gt;</tt></li><li><tt>&lt;plugins&gt;</tt></li><li><tt>&lt;properties&gt;</tt> (not actually available in the main POM, but used behind the scenes)</li><li><tt>&lt;modules&gt;</tt></li><li><tt>&lt;reporting&gt;</tt></li><li><tt>&lt;dependencyManagement&gt;</tt></li><li><tt>&lt;distributionManagement&gt;</tt></li><li>a subset of the <tt>&lt;build&gt;</tt> element, which consists of:<ul><li><tt>&lt;defaultGoal&gt;</tt></li><li><tt>&lt;resources&gt;</tt></li><li><tt>&lt;testResources&gt;</tt></li><li><tt>&lt;finalName&gt;</tt></li></ul></li></ul></div><div class="section"><h4>POM elements outside &lt;profiles&gt;<a name="POM_elements_outside_profiles"></a></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 p
 erson'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 ve
 ry 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></div></div><div class="section"><h3>Profile Pitfalls<a name="Profile_Pitfalls"></a></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><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>&lt;project&gt;
+  ...
+  &lt;build&gt;
+    &lt;plugins&gt;
+      &lt;plugin&gt;
+        &lt;groupId&gt;org.myco.plugins&lt;/groupId&gt;
+        &lt;artifactId&gt;spiffy-integrationTest-plugin&lt;/artifactId&gt;
+        &lt;version&gt;1.0&lt;/version&gt;
+        &lt;configuration&gt;
+          &lt;appserverHome&gt;${appserver.home}&lt;/appserverHome&gt;
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;
+      ...
+    &lt;/plugins&gt;
+  &lt;/build&gt;
+  ...
+&lt;/project&gt;</pre></div><p>Now, in your local <tt>~/.m2/settings.xml</tt>, you have:</p><div class="source"><pre>&lt;settings&gt;
+  ...
+  &lt;profiles&gt;
+    &lt;profile&gt;
+      &lt;id&gt;appserverConfig&lt;/id&gt;
+      &lt;properties&gt;
+        &lt;appserver.home&gt;/path/to/appserver&lt;/appserver.home&gt;
+      &lt;/properties&gt;
+    &lt;/profile&gt;
+  &lt;/profiles&gt;
+
+  &lt;activeProfiles&gt;
+    &lt;activeProfile&gt;appserverConfig&lt;/activeProfile&gt;
+  &lt;/activeProfiles&gt;
+  ...
+&lt;/settings&gt;</pre></div><p>When you build the <b>integration-test</b> lifecycle phase, your integration tests pass, since the path you've provided allows the test plugin to install and test this web application.</p><p><i>However</i>, when your colleague attempts to build to <b>integration-test</b>, his build fails spectacularly, complaining that it cannot resolve the plugin configuration parameter <tt>&lt;appserverHome&gt;</tt>, or worse, that the value of that parameter - literally <tt>${appserver.home}</tt> - is invalid (if it warns you at all).</p><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>&lt;pluginManagement&gt;</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><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>&lt;project&gt;
+  ...
+  &lt;build&gt;
+    &lt;plugins&gt;
+      &lt;plugin&gt;
+        &lt;groupId&gt;org.myco.plugins&lt;/groupId&gt;
+        &lt;artifactId&gt;spiffy-integrationTest-plugin&lt;/artifactId&gt;
+        &lt;version&gt;1.0&lt;/version&gt;
+        &lt;configuration&gt;
+          &lt;appserverHome&gt;${appserver.home}&lt;/appserverHome&gt;
+        &lt;/configuration&gt;
+      &lt;/plugin&gt;
+      ...
+    &lt;/plugins&gt;
+  &lt;/build&gt;
+  ...
+&lt;/project&gt;</pre></div><p>Now, consider the following profile, which would be specified inline in the <tt>pom.xml</tt>:</p><div class="source"><pre>&lt;project&gt;
+  ...
+  &lt;profiles&gt;
+    &lt;profile&gt;
+      &lt;id&gt;appserverConfig-dev&lt;/id&gt;
+      &lt;activation&gt;
+        &lt;property&gt;
+          &lt;name&gt;env&lt;/name&gt;
+          &lt;value&gt;dev&lt;/value&gt;
+        &lt;/property&gt;
+      &lt;/activation&gt;
+      &lt;properties&gt;
+        &lt;appserver.home&gt;/path/to/dev/appserver&lt;/appserver.home&gt;
+      &lt;/properties&gt;
+    &lt;/profile&gt;
+
+    &lt;profile&gt;
+      &lt;id&gt;appserverConfig-dev-2&lt;/id&gt;
+      &lt;activation&gt;
+        &lt;property&gt;
+          &lt;name&gt;env&lt;/name&gt;
+          &lt;value&gt;dev-2&lt;/value&gt;
+        &lt;/property&gt;
+      &lt;/activation&gt;
+      &lt;properties&gt;
+        &lt;appserver.home&gt;/path/to/another/dev/appserver2&lt;/appserver.home&gt;
+      &lt;/properties&gt;
+    &lt;/profile&gt;
+  &lt;/profiles&gt;
+  ..
+&lt;/project&gt;</pre></div><p>This profile looks quite similar to the one from the last example, with a few important exceptions: it's plainly geared toward a development environment, a new profile named <tt>appserverConfig-dev-2</tt> is added and it has an activation section that will trigger its inclusion when the system properties contain &quot;env=dev&quot; for a profile named <tt>appserverConfig-dev</tt> and &quot;env=dev-2&quot; for a profile named <tt>appserverConfig-dev-2</tt>. So, executing:</p><div class="source"><pre>mvn -Denv=dev-2 integration-test</pre></div><p>will result in a successful build, applying the properties given by profile named <tt>appserverConfig-dev-2</tt>. And when we execute</p><div class="source"><pre>mvn -Denv=dev integration-test</pre></div><p>it will result in a successful build applying the properties given by the profile named <tt>appserverConfig-dev</tt>. However, executing:</p><div class="source"><pre>mvn -Denv=production integration-t
 est</pre></div><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 &quot;production&quot; environment (env=production), along with &quot;test&quot; and possibly even &quot;local&quot; 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 profi
 les 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><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><p>Let us have some small samples that will help us to understand more on the <i>active-profiles</i> goal of that plugin.</p><p>From the last e
 xample of profiles in the <tt>pom.xml</tt>, you'll notice that there are two profiles named <tt>appserverConfig-dev</tt> and <tt>appserverConfig-dev-2</tt> which has been given different values for properties. If we go ahead and execute:</p><div class="source"><pre>  mvn help:active-profiles -Denv=dev</pre></div><p>The result will be a bulleted list of the id of the profile with an activation property of &quot;env=dev&quot; together with the source where it was declared. See sample below.</p><div class="source"><pre>The following profiles are active:
+
+ - appserverConfig-dev (source: pom)</pre></div><p>Now if we have a profile declared in <tt>settings.xml</tt> (refer to the sample of profile in <tt>settings.xml</tt>) and that have been set to be an active profile and execute:</p><div class="source"><pre>  mvn help:active-profiles</pre></div><p>The result should be something like this</p><div class="source"><pre>The following profiles are active:
+
+ - appserverConfig (source: settings.xml)</pre></div><p>Even though we don't have an activation property, a profile has been listed as active. Why? Like we mentioned before, a profile that has been set as an active profile in the <tt>settings.xml</tt> is automatically activated.</p><p>Now if we have something like a profile in the <tt>settings.xml</tt> that has been set as an active profile and also triggered a profile in the POM. Which profile do you think will have an effect on the build?</p><div class="source"><pre>  mvn help:active-profiles -P appserverConfig-dev</pre></div><p>This will list the activated profiles:</p><div class="source"><pre>The following profiles are active:
+
+ - appserverConfig-dev (source: pom)
+ - appserverConfig (source: settings.xml)</pre></div><p>Even though it listed the two active profiles, we are not sure which one of them has been applied. To see the effect on the build execute:</p><div class="source"><pre>  mvn help:effective-pom -P appserverConfig-dev</pre></div><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><p>By now you've noticed that profiles are a natural way of addressing the problem of different build configuration requirements for different target environme
 nts. Above, we discussed the concept of a &quot;natural set&quot; 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"><pre>mvn -Denv=test &lt;phase&gt;</pre></div><p>The right comma
 nd-line option can be had by simply substituting &quot;=&quot; for &quot;-&quot; in the profile id.</p></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-repositories.html
==============================================================================
--- websites/staging/maventest/trunk/content/guides/introduction/introduction-to-repositories.html (added)
+++ websites/staging/maventest/trunk/content/guides/introduction/introduction-to-repositories.html Thu Mar  1 23:08:58 2012
@@ -0,0 +1,255 @@
+<!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 Repositories</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
+Brian Fox" />
+        <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 Repositories
+      </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 Repositories<a name="Introduction_to_Repositories"></a></h2><div class="section"><h3>Artifact Repositories<a name="Artifact_Repositories"></a></h3><p>A repository in Maven is used to hold build artifacts and dependencies of varying types.</p><p>There are strictly only two types of repositories: local and remote. The local repository refers to a copy on your own installation that is a cache of the remote downloads, and also contains the temporary build artifacts that you have not yet released.</p><p>Remote repositories refer to any other type of repository, accessed by a variety of protocols such as <tt>file://</tt> and <tt>http://</tt>. These repositories might be a truly remote repository set up by a third party to provide their artifacts for downloading (for example, <a class="externalLink" href="http://repo1.maven.org/maven2/">repo1.maven.org</a> and <a class="externalLink" href="http://uk.maven.org/maven2/">uk.maven.org</a
 > house Maven's central repository). Other &quot;remote&quot; repositories may be internal repositories set up on a file or HTTP server within your company, used to share private artifacts between development teams and for releases.</p><p>The local and remote repositories are structured the same way so that scripts can easily be run on either side, or they can be synced for offline used. In general use, the layout of the repositories is completely transparent to the Maven user, however.</p></div><div class="section"><h3>Why not Store JARs in CVS?<a name="Why_not_Store_JARs_in_CVS"></a></h3><p>It is not recommended that you store your JARs in CVS. Maven tries to promote the notion of a user local repository where JARs, or any project artifacts, can be stored and used for any number of builds. Many projects have dependencies such as XML parsers and standard utilities that are often replicated in typical builds. With Maven these standard utilities can be stored in your local re
 pository and shared by any number of builds.</p><p>This has the following advantages:</p><ul><li><b>It uses less storage</b> - while a repository is typically quite large, because each JAR is only kept in the one place it is actually saving space, even though it may not seem that way</li><li><b>It makes checking out a project quicker</b> - initial checkout, and to a small degree updating, a project will be faster if there are no large binary files in CVS. While they may need to be downloaded again afterwards anyway, this only happens once and may not be necessary for some common JARs already in place.</li><li><b>No need for versioning</b> - CVS and other source control systems are designed for versioning files, but external dependencies typically don't change, or if they do their filename changes anyway to indicate the new version. Storing these in CVS doesn't have any added benefit over keeping them in a local artifact cache.</li></ul></div><div class="section"><h3>Using Re
 positories<a name="Using_Repositories"></a></h3><p>In general, you should not need to do anything with the local repository on a regular basis, except clean it out if you are short on disk space (or erase it completely if you are willing to download everything again).</p><p>For the remote repositories, they are used for both downloading and uploading (if you have the permission to do so).</p><div class="section"><h4>Downloading from a Remote Repository<a name="Downloading_from_a_Remote_Repository"></a></h4><p>Downloading in Maven is triggered by a project declaring a dependency that is not present in the local repository (or for a <tt>SNAPSHOT</tt>, when the remote repository contains one that is newer). By default, Maven will download from the <a class="externalLink" href="http://repo1.maven.org/maven2/">central</a> repository.</p><p>To override this, you need to specify a <tt>mirror</tt> as shown in <a href="../mini/guide-mirror-settings.html">Using Mirrors for Repositorie
 s</a></p><p>You can set this in your <tt>settings.xml</tt> file to globally use a certain mirror, however note that it is common for a project to customise the repository in their <tt>pom.xml</tt> and that your setting will take precedence. If you find that dependencies are not being found, check you have not overridden the remote repository.</p><p>For more information on dependencies, see <a href="./introduction-to-dependency-mechanism.html">Dependency Mechanism</a>.</p></div><div class="section"><h4>Using Mirrors for the Central Repository<a name="Using_Mirrors_for_the_Central_Repository"></a></h4><p>There are several official Central repositories geographically distributed. You can make changes to your <tt>settings.xml</tt> file to use one or more mirrors. Instructions for this can be found in the guide <a href="../mini/guide-mirror-settings.html">Using Mirrors for Repositories</a>.</p></div></div><div class="section"><h3>Building Offline<a name="Building_Offline"></a></h
 3><p>If you are temporarily disconnected from the internet and you need to build your projects offline you can use the offline switch on the CLI:</p><div class="source"><pre>
+ mvn -o package
+</pre></div><p>Note that many plugins will honour the offline setting and not perform any operations that would connect to the internet. Some examples are resolving Javadoc links and link checking the site.</p></div><div class="section"><h3>Uploading to a Remote Repository<a name="Uploading_to_a_Remote_Repository"></a></h3><p>While this is possible for any type of remote repository, you must have the permission to do so. To have someone upload to the central Maven repository, see <a href="../../repository/index.html">Repository Center</a>.</p></div></div><div class="section"><h2>Internal Repositories<a name="Internal_Repositories"></a></h2><p>When using Maven, particularly in a corporate environment, connecting to the internet to download dependencies is not acceptable for security, speed or bandwidth reasons. For that reason, it is desirable to set up an internal repository to house a copy of artifacts, and to publish private artifacts to.</p><p>Such an internal repository
 can be downloaded from using HTTP or the file system (using a <tt>file://</tt> URL), and uploaded to using SCP, FTP, or a file copy.</p><p>Note that as far as Maven is concerned, there is nothing special about this repository: it is another <b>remote repository</b> that contains artifacts to download to a user's local cache, and is a publish destination for artifact releases.</p><p>Additionally, you may want to share the repository server with your generated project sites. For more information on creating and deploying sites, see <a href="../mini/guide-site.html">Creating a Site</a>.</p><div class="section"><h3>Setting up the Internal Repository<a name="Setting_up_the_Internal_Repository"></a></h3><p>To set up an internal repository just requires that you have a place to put it, and then start copying required artifacts there using the same layout as in a remote repository such as <a class="externalLink" href="http://repo1.maven.org/maven2/">repo1.maven.org</a>.</p><p>It is
 <i>not</i> recommended that you scrape or <tt>rsync://</tt> a full copy of central as there is a large amount of data there and doing so will get you banned. You can use a program such as those described on the <a href="../../repository-management.html">Repository Management</a> page to run your internal repository's server, to download from the internet as required and then hold the artifacts in your internal repository for faster downloading later.</p><p>The other options available are to manually download and vet releases, then copy them to the internal repository, or to have Maven download them for a user, and manually upload the vetted artifacts to the internal repository which is used for releases. This step is the only one available for artifacts where the license forbids their distribution automatically, such as several J2EE JARs provided by Sun. Refer to the <a href="../mini/guide-coping-with-sun-jars.html">Guide to coping with SUN JARs</a> document for more informa
 tion.</p><p>It should be noted that Maven intends to include enhanced support for such features in the future, including click through licenses on downloading, and verification of signatures.</p></div><div class="section"><h3>Using the Internal Repository<a name="Using_the_Internal_Repository"></a></h3><p>Using the internal repository is quite simple. Simply make a change to add a <tt>repositories</tt> element:</p><div class="source"><pre>
+&lt;project&gt;
+  ...
+  &lt;repositories&gt;
+    &lt;repository&gt;
+      &lt;id&gt;my-internal-site&lt;/id&gt;
+      &lt;url&gt;http://myserver/repo&lt;/url&gt;
+    &lt;/repository&gt;
+  &lt;/repositories&gt;
+  ...
+&lt;/project&gt;
+</pre></div><p>If your internal repository requires authentication, the <tt>id</tt> element can be used in your <a href="../../settings.html#Servers">settings</a> file to specify login information.</p></div><div class="section"><h3>Deploying to the Internal Repository<a name="Deploying_to_the_Internal_Repository"></a></h3><p>One of the most important reasons to have one or more internal repositories is to be able to publish your own private releases to share.</p><p>To publish to the repository, you will need to have access via one of SCP, SFTP, FTP, WebDAV, or the filesystem. Connectivity is accomplished with the various <a class="externalLink" href="http://maven.apache.org/wagon/wagon-providers/index.html">wagons</a>. Some wagons may need to be added as <a class="externalLink" href="http://maven.apache.org/ref/current/maven-model/maven.html#class_extension">extension</a> to your build.</p><!-- For example, to set up an SCP transfer. --><!-- show the scp example. --></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>


Loading...