You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2008/05/30 18:24:00 UTC

svn commit: r661780 - /maven/shared/trunk/maven-invoker/src/site/apt/usage.apt

Author: bentmann
Date: Fri May 30 09:24:00 2008
New Revision: 661780

URL: http://svn.apache.org/viewvc?rev=661780&view=rev
Log:
o Added some words about invoker usage in combination with surefire

Modified:
    maven/shared/trunk/maven-invoker/src/site/apt/usage.apt

Modified: maven/shared/trunk/maven-invoker/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-invoker/src/site/apt/usage.apt?rev=661780&r1=661779&r2=661780&view=diff
==============================================================================
--- maven/shared/trunk/maven-invoker/src/site/apt/usage.apt (original)
+++ maven/shared/trunk/maven-invoker/src/site/apt/usage.apt Fri May 30 09:24:00 2008
@@ -8,7 +8,7 @@
 
 Usage
 
-  This page documents the basic usage of the process invocation API.
+  This page documents the basic usage of the Maven invocation API.
   
 * Hello, World
 
@@ -30,6 +30,41 @@
   for the project defined at <<</path/to/pom.xml>>>. If the build fails, we will
   remain blissfully ignorant...
   
+* Configuring the Maven Home Directory
+
+  You can use the method <<<Invoker.setMavenHome()>>> to specify which Maven executable should be used to fork the
+  build. If you don't provide an explicit value for this setting, the <<<Invoker>>> will automatically try to detect
+  a Maven installation by evaluating the system property <<<maven.home>>> and the environment variable <<<M2_HOME>>>.
+
+  <Note:> If you use the invocation API in tests run by the {{{../../plugins/maven-surefire-plugin}Maven Surefire Plugin}},
+  you need to tell Surefire to pass the system property <<<maven.home>>> to the tests in order for the automatic Maven
+  detection to work:
+
++---+
+<project>
+  ...
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.4.3</version>
+        <configuration>
+          <systemProperties>
+            <property>
+              <name>maven.home</name>
+              <value>${maven.home}</value>
+            </property>
+          </systemProperties>
+        </configuration>
+      </plugin>
+    </plugins>
+    ...
+  </build>
+  ...
+</project>
++---+
+
 * Checking the Exit Code
 
   If we wanted to detect a build failure in the above example, we could simply