Author: dennisl
Date: Sat Aug 2 04:15:09 2008
New Revision: 681950
URL: http://svn.apache.org/viewvc?rev=681950&view=rev
Log:
o Add license headers.
o Fix error in code example.
o Fix typos and formating.
Modified:
maven/shared/trunk/maven-invoker/src/site/apt/index.apt
maven/shared/trunk/maven-invoker/src/site/apt/usage.apt
Modified: maven/shared/trunk/maven-invoker/src/site/apt/index.apt
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-invoker/src/site/apt/index.apt?rev=681950&r1=681949&r2=681950&view=diff
==============================================================================
--- maven/shared/trunk/maven-invoker/src/site/apt/index.apt (original)
+++ maven/shared/trunk/maven-invoker/src/site/apt/index.apt Sat Aug 2 04:15:09
2008
@@ -3,16 +3,36 @@
---
John Casey
---
- 31-May-2006
+ 2008-08-02
---
+ ~~ 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/references/apt-format.html
+
Maven Process Invoker
In many cases, tools (including Maven itself) may want to fire off a Maven
build in a clean environment. Why? Perhaps you want to avoid polluting the
current system environment with side-effects produced by Maven plugins. Maybe
you want to run the build from a different working directory than the current
- <<<${user.dir}>>>. Maybe you want to retain the ability to surgically kill
one
+ <<<$\{user.dir\}>>>. Maybe you want to retain the ability to surgically kill
one
of many Maven builds if it hangs for some reason.
This API is concerned with firing a Maven build in a new JVM. It accomplishes
@@ -20,7 +40,7 @@
in the current request, along with those global options specified in the
invoker itself. Once it has the command line, the invoker will execute it,
and
capture the resulting exit code or any exception thrown to signal a failure
to
- execute. Input/Output control can be specified using an <<<InputStream>>> and
+ execute. Input/output control can be specified using an <<<InputStream>>> and
up to two <<<InvocationOutputHandler>>>s.
* Features
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=681950&r1=681949&r2=681950&view=diff
==============================================================================
--- maven/shared/trunk/maven-invoker/src/site/apt/usage.apt (original)
+++ maven/shared/trunk/maven-invoker/src/site/apt/usage.apt Sat Aug 2 04:15:09
2008
@@ -3,20 +3,40 @@
---
John Casey
---
- 31-May-2006
+ 2008-08-02
---
+ ~~ 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/references/apt-format.html
+
Usage
This page documents the basic usage of the Maven invocation API.
-
+
* Hello, World
The simplest possible way to use the invocation API is to construct the
invoker and request at the same time, and simply call
<<<invoker.execute(request)>>>. In this example, we don't care about the
build
result:
-
+
+---+
InvocationRequest request = new DefaultInvocationRequest();
request.setPomFile( new File( "/path/to/pom.xml" ) );
@@ -32,11 +52,11 @@
* 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
+ You can use the method <<<Invoker.setMavenHome()>>> to specify which Maven
executable it should use.
+ 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}},
+ <<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:
@@ -82,7 +102,7 @@
This will retrieve the exit code from the invocation result, and throw
an exception if it's not <<<0>>> (the traditional all-clear code). Note that
we could capture the build output by adding an <<<InvocationOutputHandler>>>
- instance to either the <<<invoker>>> or <<<request>>>.
+ instance to either the <<<invoker>>> or the <<<request>>>.
* Caching the Invoker
@@ -122,7 +142,8 @@
{
if ( result.getExecutionException() != null )
{
- throw new PublishException( "Failed to publish site.", e );
+ throw new PublishException( "Failed to publish site.",
+ result.getExecutionException() );
}
else
{
@@ -137,6 +158,6 @@
site-generation artifacts will most likely be common to most sites), the same
invoker instance (it's configured, we may as well reuse it), and the same set
of goals per build. We can actually accommodate a fairly complex
configuration
- of the Invoker without adding complexity to the publish method in this
manner.
+ of the Invoker without adding complexity to the <<<publishSite>>> method in
this manner.