You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by pg...@apache.org on 2009/05/06 17:07:53 UTC
svn commit: r772296 -
/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/site/apt/usage.apt
Author: pgier
Date: Wed May 6 15:07:53 2009
New Revision: 772296
URL: http://svn.apache.org/viewvc?rev=772296&view=rev
Log:
Some improvements to the site docs.
Modified:
maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/site/apt/usage.apt
Modified: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/site/apt/usage.apt?rev=772296&r1=772295&r2=772296&view=diff
==============================================================================
--- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/site/apt/usage.apt (original)
+++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/site/apt/usage.apt Wed May 6 15:07:53 2009
@@ -60,14 +60,6 @@
</javac>
-----
- <(since 2.0.8)> For each dependency resolved using either inline declaration or a pom reference, the property
- <<<groupId:artifactId:type[:classifier]>>> is defined pointing to the corresponding file. For example,
- a resolved dependency on junit can be accessed in the following way:
-
------
-<echo message="JUnit jar file downloaded to ${junit:junit:jar}"/>
------
-
Another option you can use is <<<filesetId>>>, which will give you a fileset reference that can be used to copy
files into a particular location. For example, to populate <<<WEB-INF/lib>>> with your dependencies
you could use the following:
@@ -138,6 +130,16 @@
It can be omitted if Maven Ant Tasks was
{{{installation.html#lib} installed in Ant's <<<lib>>> directory}}.
+** Accessing dependencies using properties
+
+ <(since 2.0.8)> For each dependency resolved using either inline declaration or a pom reference, the property
+ <<<groupId:artifactId:type[:classifier]>>> is defined pointing to the corresponding file. For example,
+ a resolved dependency on junit can be accessed in the following way:
+
+-----
+<echo message="JUnit jar file downloaded to ${junit:junit:jar}"/>
+-----
+
* Declaring Repositories
All of the tasks can optionally take one or more remote repositories to download from and upload to, and a
@@ -235,22 +237,35 @@
you can use the following:
-----
- <artifact:pom id="maven.project" file="pom.xml" />
+ <artifact:pom id="mypom" file="pom.xml" />
- <echo>The version is ${maven.project.version}</echo>
+ <echo>The version is ${mypom.version}</echo>
-----
You can also access nested parts of the POM. For example, you can read the default value of the <<<directory>>>
element within the <<<build>>> element using a <<<.>>> separator.
-----
- <artifact:pom id="project" file="pom.xml" />
+ <artifact:pom id="mypom" file="pom.xml" />
- <echo>The build directory is ${project.build.directory}</echo>
+ <echo>The build directory is ${mypom.build.directory}</echo>
-----
For more information on the elements available in the POM, see the {{{http://maven.apache.org/maven-model/maven.html} descriptor reference}}.
+** Accessing dependencies in the POM
+
+ The <<<pom>>> task can be used in combination with the <<<dependencies>>> task to declare a list of dependencies.
+
+-----
+ <artifact:pom id="mypom" file="pom.xml" />
+
+ <artifact:dependencies filesetId="mydeps" pomRefId="mypom" />
+-----
+
+ In this example, the <<<dependencies>>> task in this example will resolve the list of dependencies in the pom
+ and add them to the fileset.
+
** Using profiles in the POM
POM profiles can be activated or deactivated using the nested profile element. For example