You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2013/01/25 23:21:16 UTC

svn commit: r847984 [7/7] - in /websites/production/maven/content/ant-tasks-archives/ant-tasks-current: ./ css/ examples/ images/ images/logos/

Added: websites/production/maven/content/ant-tasks-archives/ant-tasks-current/usage.html
==============================================================================
--- websites/production/maven/content/ant-tasks-archives/ant-tasks-current/usage.html (added)
+++ websites/production/maven/content/ant-tasks-archives/ant-tasks-current/usage.html Fri Jan 25 22:21:15 2013
@@ -0,0 +1,248 @@
+<!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 Jan 25, 2013
+ | Rendered using Apache Maven Stylus Skin 1.5
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <title>Maven Ant Tasks - Usage</title>
+    <style type="text/css" media="all">
+      @import url("./css/maven-base.css");
+      @import url("./css/maven-theme.css");
+      @import url("./css/site.css");
+    </style>
+    <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
+        <meta name="author" content="Brett Porter
+Hervé Boutemy" />
+        <meta name="Date-Creation-yyyymmdd" content="20080717" />
+    <meta name="Date-Revision-yyyymmdd" content="20130125" />
+    <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;
+                      <a href="./">Maven Ant Tasks</a>
+        &gt;
+        Usage
+        </div>
+            <div class="xright">        
+                                    Last Published: 2013-01-25
+              &nbsp;| Version: 2.1.4-SNAPSHOT
+            </div>
+      <div class="clear">
+        <hr/>
+      </div>
+    </div>
+    <div id="leftColumn">
+      <div id="navcolumn">
+             
+                                                   <h5>Overview</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="index.html">Introduction</a>
+            </li>
+                  <li class="none">
+                  <a href="download.html">Download</a>
+            </li>
+                  <li class="none">
+                  <a href="installation.html">Installation</a>
+            </li>
+                  <li class="none">
+            <strong>Usage</strong>
+          </li>
+                  <li class="none">
+                  <a href="release-notes.html">Release Notes</a>
+            </li>
+                  <li class="none">
+                  <a href="faq.html">FAQ</a>
+            </li>
+          </ul>
+                       <h5>Examples</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="examples/dependencies.html">dependencies</a>
+            </li>
+                  <li class="none">
+                  <a href="examples/install-deploy.html">install, deploy</a>
+            </li>
+                  <li class="none">
+                  <a href="examples/pom.html">pom</a>
+            </li>
+                  <li class="none">
+                  <a href="examples/write-pom.html">writepom</a>
+            </li>
+                  <li class="none">
+                  <a href="examples/mvn.html">mvn</a>
+            </li>
+          </ul>
+                       <h5>Reference</h5>
+                  <ul>
+                  <li class="none">
+                  <a href="reference.html#dependencies">dependencies</a>
+            </li>
+                  <li class="none">
+                  <a href="reference.html#install">install, deploy</a>
+            </li>
+                  <li class="none">
+                  <a href="reference.html#install-provider">install-provider</a>
+            </li>
+                  <li class="none">
+                  <a href="reference.html#localRepository">localRepository</a>
+            </li>
+                  <li class="none">
+                  <a href="reference.html#remoteRepository">remoteRepository</a>
+            </li>
+                  <li class="none">
+                  <a href="reference.html#pom">pom</a>
+            </li>
+                  <li class="none">
+                  <a href="reference.html#writepom">writepom</a>
+            </li>
+                  <li class="none">
+                  <a href="reference.html#versionMapper">versionMapper</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="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="../pom/index.html">Parent POMs</a>
+            </li>
+                  <li class="none">
+                  <a href="../plugins/index.html">Plugins</a>
+            </li>
+                  <li class="none">
+                  <a href="../plugin-tools/index.html">Plugin Tools</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="../skins/index.html">Skins</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">
+        <!-- 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/referen
 ces/apt-format.html --><div class="section"><h2>Using Maven Ant Tasks<a name="Using_Maven_Ant_Tasks"></a></h2><div class="section"><h3>Declaring Dependencies<a name="Declaring_Dependencies"></a></h3><p>The main purpose of the Maven Ant Tasks is to utilize Maven's <a class="externalLink" href="http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html"> dependency management features</a>.</p><p>This is achieved with the <tt>dependencies</tt> task. The simplest usage involves specifying your dependencies inline, such as in the following example:</p><div><pre>&lt;artifact:dependencies pathId=&quot;dependency.classpath&quot;&gt;
+  &lt;dependency groupId=&quot;junit&quot; artifactId=&quot;junit&quot; version=&quot;3.8.2&quot; scope=&quot;test&quot;/&gt;
+  &lt;dependency groupId=&quot;org.codehaus.modello&quot; artifactId=&quot;modello-core&quot; version=&quot;1.0-alpha-2-SNAPSHOT&quot;/&gt;
+  &lt;dependency groupId=&quot;javax.servlet&quot; artifactId=&quot;servlet-api&quot; version=&quot;2.4&quot; scope=&quot;provided&quot;/&gt;
+&lt;/artifact:dependencies&gt;</pre></div><p>The above example will download those 3 dependencies, and their dependencies, and so on. They will be stored in the default local repository location, <tt>${user.home}/.m2/repository</tt>.</p><p>You may have noticed the <tt>pathId</tt> reference. This is optional, but if given will create a classpath reference that includes the local files downloaded as dependencies. This is usually used to pass to <tt>javac</tt> or other tasks:</p><p>You can also use a Maven 2.0 POM to declare your dependencies, which is <a href="./examples/pom.html"> described in the examples</a>. This is the recommended practice so that you can reuse the file to deploy your own artifacts.</p><p>For more examples of using the dependencies task, see the <a href="./examples/dependencies.html"> examples page</a>.</p></div><div class="section"><h3>Installing and Deploying Your Own Artifacts to a Repository<a name="Installing_and_Deploying_Your_Own_Artifacts_to_a_Rep
 ository"></a></h3><p>Maven allows artifacts to be shared between projects by using local and remote repository. The <tt>install</tt> task allows an artifact to be copied to the local maven repository (typically located in ~/.m2/repository).</p><p>The <tt>deploy</tt> task allows artifacts to be deployed to a remote maven repository where they will be available to other projects.</p><p>For examples of using the install and deploy tasks, see the <a href="./examples/install-deploy.html"> examples page</a>.</p></div><div class="section"><h3>Using a Maven <a name="POM">POM</a> File<a name="Using_a_Maven_POM_File"></a></h3><p>In Maven, the Project Object Model (POM) represents a unit of work - one exists for each artifact that is built.</p><p>A Maven 2.0 POM file is required for deploying your own artifact to a repository for use in the dependencies elements of other projects.</p><p>It can also be reused for declaring your own dependencies, instead of specifying the inline version 
 given earlier.</p><p>For examples of creating a pom and using the <tt>pom</tt> task, see the <a href="./examples/pom.html">examples page</a>.</p></div><div class="section"><h3>Declaring Repositories<a name="Declaring_Repositories"></a></h3><p>All of the tasks can optionally take one or more remote repositories to download from and upload to, and a local repository to store downloaded and installed archives to.</p><p>These can be specified inline, or if you choose to reuse them, they can be declared with an <tt>id</tt>/<tt>refid</tt> combination.</p><p>For example, you can specify the remote repository you want to use:</p><div><pre>&lt;artifact:remoteRepository id=&quot;remote.repository&quot; url=&quot;http://repository.mycompany.com/&quot; /&gt;
+...
+&lt;artifact:dependencies&gt;
+  &lt;!-- Your dependency definitions go here --&gt;
+  ...
+  &lt;remoteRepository refid=&quot;remote.repository&quot; /&gt;
+&lt;/artifact:dependencies&gt;</pre></div><p>The default <a class="externalLink" href="http://repo1.maven.org/maven2/"> central</a> repository is automatically added to remote repositories. Until 2.0.10, if at least one remote repository was specified, central was not automatically added: you had to declare it if you needed it.</p><p><b>Note:</b> to work with transitive dependencies, you <i>must</i> use a Maven 2.0 repository.</p><p>If your repository requires authentication, you can provide this as a nested element. It accepts the attributes <tt>username</tt>, <tt>password</tt>, and for SSH based repositories <tt>privateKey</tt> and <tt>passphrase</tt>. For example:</p><div><pre>&lt;authentication username=&quot;brett&quot; privateKey=&quot;${user.home}/.ssh/id_dsa&quot; /&gt;</pre></div></div><div class="section"><h3>The Settings File<a name="The_Settings_File"></a></h3><p>The POM can be used to represent most of the information that the tasks have access to, including rem
 ote repositories. Information that are user or environment specific, such as the <tt>authentication</tt> tag, are specified in the <tt>settings.xml</tt> file in Maven, and can also be accessed from the Ant tasks.</p><p>The file is first looked for in <tt>${user.home}/.ant/settings.xml</tt>, then in <tt>${user.home}/.m2/settings.xml</tt> so that the settings can be shared with Maven 2.0 itself. Since 2.0.7, it is then looked for in <tt>${ANT_HOME}/etc/settings.xml</tt>, then in <tt>${M2_HOME}/conf/settings.xml</tt> so that the settings can be set for all users.</p><p>Since 2.0.6, you can provide access to a settings file anywhere using <tt>settingsFile</tt> attribute:</p><div><pre>&lt;artifact:dependencies settingsFile=&quot;/opt/maven/conf/settings.xml&quot;&gt;
+  ...
+&lt;/artifact:dependencies&gt;</pre></div><p>For example, to specify your proxy settings, you would specify the following <tt>settings.xml</tt> file:</p><div><pre>&lt;settings&gt;
+  &lt;proxies&gt;
+    &lt;proxy&gt;
+      &lt;protocol&gt;http&lt;/protocol&gt;
+      &lt;host&gt;proxy.host.net&lt;/host&gt;
+      &lt;port&gt;8080&lt;/port&gt;
+      &lt;nonProxyHosts&gt;localhost&lt;/nonProxyHosts&gt;
+    &lt;/proxy&gt;
+  &lt;/proxies&gt;
+&lt;/settings&gt;</pre></div><p>Or to specify a <tt>central</tt> mirror, you would specify the following <tt>settings.xml</tt> file:</p><div><pre>&lt;settings&gt;
+  &lt;mirrors&gt;
+    &lt;mirror&gt;
+      &lt;id&gt;central.mirror&lt;/id&gt;
+      &lt;url&gt;http://mirror.host.net/maven2&lt;/url&gt;
+      &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;
+    &lt;/mirror&gt;
+  &lt;/mirrors&gt;
+&lt;/settings&gt;</pre></div><p>For more information on configuring <tt>settings.xml</tt>, see:</p><ul><li><a class="externalLink" href="http://maven.apache.org/guides/mini/guide-configuring-maven.html"> Configuring Maven</a>.</li><li><a class="externalLink" href="http://maven.apache.org/settings.html"> Information about configuring settings.xml</a>.</li><li><a class="externalLink" href="http://maven.apache.org/ref/current/maven-settings/settings.html"> Settings Descriptor Reference</a>.</li><li><a class="externalLink" href="http://maven.apache.org/guides/mini/guide-mirror-settings.html"> Using Mirrors for Repositories</a>.</li></ul></div><div class="section"><h3>More Examples<a name="More_Examples"></a></h3><ul><li>Maven Ant Tasks's <a class="externalLink" href="http://svn.apache.org/repos/asf/maven/ant-tasks/trunk/build-tests.xml"> build-tests.xml</a> is a sample Ant script showing most of the functionality in action (it's used as unit-tests).</li><li>Maven itself can be b
 ootstrapped using Maven Ant Tasks: see <a class="externalLink" href="http://svn.apache.org/repos/asf/maven/maven-3/trunk/build.xml"> build.xml</a> in Maven Core sources. Note that most content is about building Maven project: there is only a little part that is using Maven Ant Tasks, to get dependencies, ie the <tt>pull</tt> target (with its <tt>depends</tt> targets).</li></ul></div></div>
+      </div>
+    </div>
+    <div class="clear">
+      <hr/>
+    </div>
+    <div id="footer">
+      <div class="xright">
+        &#169;            2002-2013
+              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>
\ No newline at end of file

Propchange: websites/production/maven/content/ant-tasks-archives/ant-tasks-current/usage.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/maven/content/ant-tasks-archives/ant-tasks-current/usage.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision