You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2007/05/31 20:05:17 UTC

svn commit: r543201 - /maven/site/trunk/src/site/apt/ant-tasks.apt

Author: jvanzyl
Date: Thu May 31 11:05:16 2007
New Revision: 543201

URL: http://svn.apache.org/viewvc?view=rev&rev=543201
Log:
o accompanying doco for MANTTASKS-29

Modified:
    maven/site/trunk/src/site/apt/ant-tasks.apt

Modified: maven/site/trunk/src/site/apt/ant-tasks.apt
URL: http://svn.apache.org/viewvc/maven/site/trunk/src/site/apt/ant-tasks.apt?view=diff&rev=543201&r1=543200&r2=543201
==============================================================================
--- maven/site/trunk/src/site/apt/ant-tasks.apt (original)
+++ maven/site/trunk/src/site/apt/ant-tasks.apt Thu May 31 11:05:16 2007
@@ -52,11 +52,9 @@
 -----
 <project ... xmlns:artifact="urn:maven-artifact-ant">
   ...
-  <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant">
-    <classpath>
-      <pathelement location="lib/maven-ant-tasks-2.0.6.jar" />
-    </classpath>
-  </typedef>
+  <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.0.6.jar" />
+  <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
+           classpathref="maven-ant-tasks.classpath" />
   ...
 -----
 
@@ -118,6 +116,31 @@
   transitive dependencies and is useful for building different types of classpaths. To see how it affects
   the behaviour of the dependencies, see the {{{guides/introduction/introduction-to-dependency-mechanism.html} Dependency Mechanism}}
   documentation in the Maven 2.0 site.
+  
+  Other options are:
+  
+    * <<<sourcesFilesetId>>>, which will give you a fileset reference containing sources artifacts,
+    
+    * <<<org.apache.maven.artifact.ant.VersionMapper>>>, which can be used to drop version numbers in filenames
+
+  For example, to populate <<<lib>>> with your dependencies without version in filename and <<<lib/src>>> with corresponding sources:
+
+-----
+<artifact:dependencies filesetId="dependency.fileset"
+        sourcesFilesetId="sources.dependency.fileset" versionsId="dependency.versions">
+  ...
+</artifact:dependencies>
+<copy todir="lib">
+  <fileset refid="dependency.fileset" />
+  <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper"
+          from="${dependency.versions}" to="flatten" />
+</copy>
+<copy todir="lib/src">
+  <fileset refid="sources.dependency.fileset" />
+  <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper"
+          from="${dependency.versions}" to="flatten" />
+</copy>
+-----
 
 * Declaring Repositories
 
@@ -296,8 +319,9 @@
   specified in the <<<settings.xml>>> file in Maven, and can be accessed from the Ant tasks also.
 
   The file is first looked for in <<<$\{user.home\}/.ant/settings.xml>>>, then in <<<$\{user.home\}/.m2/settings.xml>>>
-  so that the settings can be shared with Maven 2.0 itself. Note that it is <<not>> looked for in
-  <<<$\{M2_HOME\}/conf/settings.xml>>> for the moment.
+  so that the settings can be shared with Maven 2.0 itself. Since 2.0.6.1, it is then looked for in
+  <<<$\{ANT_HOME\}/etc/settings.xml>>>, then in <<<$\{M2_HOME\}/conf/settings.xml>>> so that the settings
+  can be set for all users.
   
   Since 2.0.6, you can read a settings file anywhere using <<<settingsFile>>> attribute:
 
@@ -387,6 +411,8 @@
 *-------------------------+--------------------------------------------------------+
 | <<<sourcesFilesetId>>>  | The reference ID to store a fileset under for the sources attachements of the resolved dependencies. <(since 2.0.6)>
 *-------------------------+--------------------------------------------------------+
+| <<<versionsId>>>        | The property ID to store versions of the resolved dependencies, for <<<VersionMapper>>> use. <(since 2.0.6.1)>
+*-------------------------+--------------------------------------------------------+
 | <<<useScope>>>          | The scope to be retrieved.
 *-------------------------+--------------------------------------------------------+
 | <<<type>>>              | The type of artifacts to be retrieved. The default is <<<jar>>>.
@@ -397,6 +423,16 @@
        a single <<<pom>>> element,
        or a pomRefId attribute 
        or one or more <<<dependency>>> element(s).
+
+  If you have set a value for <<<versionsId>>>, you can later use <<<VersionMapper>>>, for example during a copy:
+
+-----
+<copy todir="...">
+  <fileset refid="..." />
+  <mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper"
+          from="${...versionId value...}" to="flatten" />
+</copy>
+-----
 
 ** <<<dependency>>>