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 2009/01/18 14:40:13 UTC
svn commit: r735456 - in /maven/plugins/trunk/maven-invoker-plugin/src:
it/invocation-project/ it/invocation-project/src/
it/invocation-project/src/it/ it/invocation-project/src/it/project/
it/invocation-project/src/it/project/sub-1/ it/invocation-proj...
Author: bentmann
Date: Sun Jan 18 05:40:12 2009
New Revision: 735456
URL: http://svn.apache.org/viewvc?rev=735456&view=rev
Log:
[MINVOKER-74] Allow to specify alternative POMs during multi-module builds
Added:
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/pom.xml (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/pom.xml (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/setup.bsh (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-1/
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-1/pom.xml (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-2/
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-2/pom.xml (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-3/
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-3/pom.xml (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/settings.xml (with props)
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/verify.bsh (with props)
Modified:
maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerProperties.java
maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/invoker-properties.apt.vm
maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerPropertiesTest.java
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/pom.xml?rev=735456&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/pom.xml Sun Jan 18 05:40:12 2009
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.invoker</groupId>
+ <artifactId>invocation-project</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <description>
+ Test to check that invocations can use a different POM than the one that was selected via the pomInclude
+ parameter. This allows fine-grained control over the build of a multi-module project where the modules are
+ (intentionally) not collectively build by the reactor.
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ <settingsFile>src/it/settings.xml</settingsFile>
+ <preBuildHookScript>setup.bsh</preBuildHookScript>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties?rev=735456&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties Sun Jan 18 05:40:12 2009
@@ -0,0 +1,6 @@
+# path to POM
+invoker.project = sub-1/pom.xml
+
+# path to base directory
+invoker.project.2 = sub-3
+invoker.goals.2 = clean
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/pom.xml?rev=735456&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/pom.xml Sun Jan 18 05:40:12 2009
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>test</groupId>
+ <artifactId>aggregator</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>sub-1</module>
+ <module>sub-2</module>
+ <module>sub-3</module>
+ </modules>
+</project>
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/setup.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/setup.bsh?rev=735456&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/setup.bsh (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/setup.bsh Sun Jan 18 05:40:12 2009
@@ -0,0 +1,21 @@
+import java.io.*;
+
+String[] paths =
+{
+ "target",
+ "sub-1/target",
+ "sub-2/target",
+ "sub-3/target",
+};
+
+for ( String path : paths )
+{
+ File dir = new File( basedir, path);
+ System.out.println( "Creating directory: " + dir );
+ if ( !dir.mkdirs() )
+ {
+ throw new IOException( "Failed to create directory: " + dir );
+ }
+}
+
+return true;
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/setup.bsh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/setup.bsh
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-1/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-1/pom.xml?rev=735456&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-1/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-1/pom.xml Sun Jan 18 05:40:12 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>test</groupId>
+ <artifactId>sub-1</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+</project>
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-1/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-1/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-2/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-2/pom.xml?rev=735456&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-2/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-2/pom.xml Sun Jan 18 05:40:12 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>test</groupId>
+ <artifactId>sub-2</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+</project>
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-2/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-2/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-3/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-3/pom.xml?rev=735456&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-3/pom.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-3/pom.xml Sun Jan 18 05:40:12 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>test</groupId>
+ <artifactId>sub-3</artifactId>
+ <version>0.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+</project>
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-3/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/sub-3/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/settings.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/settings.xml?rev=735456&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/settings.xml (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/settings.xml Sun Jan 18 05:40:12 2009
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<settings>
+ <profiles>
+ <profile>
+ <id>it-repo</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <!--
+ NOTE: We don't use @localRepository@ here which refers to the isolated local repository of the ITs and is quite
+ empty. In contrast, @invoker.repo.local@ has been defined to refer to the original local repository which is a
+ far better source for artifacts.
+ -->
+ <repositories>
+ <repository>
+ <id>local.central</id>
+ <url>file://@invoker.repo.local@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>local.central</id>
+ <url>file://@invoker.repo.local@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+</settings>
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/settings.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/settings.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/verify.bsh?rev=735456&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/verify.bsh (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/verify.bsh Sun Jan 18 05:40:12 2009
@@ -0,0 +1,35 @@
+import java.io.*;
+
+String[] unexpectedPaths =
+{
+ "sub-1/target",
+ "sub-3/target",
+};
+
+for ( String path : unexpectedPaths )
+{
+ File file = new File( new File( basedir, "target/it/project" ), path);
+ System.out.println( "Creating for absence of: " + file );
+ if ( file.exists() )
+ {
+ throw new IOException( "Unexpected path found: " + file );
+ }
+}
+
+String[] expectedPaths =
+{
+ "target",
+ "sub-2/target",
+};
+
+for ( String path : expectedPaths )
+{
+ File file = new File( new File( basedir, "target/it/project" ), path);
+ System.out.println( "Creating for existence of: " + file );
+ if ( !file.exists() )
+ {
+ throw new IOException( "Expected path not found: " + file );
+ }
+}
+
+return true;
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/verify.bsh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/verify.bsh
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java?rev=735456&r1=735455&r2=735456&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java Sun Jan 18 05:40:12 2009
@@ -424,28 +424,34 @@
* <pre>
* # A comma or space separated list of goals/phases to execute, may
* # specify an empty list to execute the default goal of the IT project
- * invoker.goals=clean install
+ * invoker.goals = clean install
*
* # Optionally, a list of goals to run during further invocations of Maven
- * invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run
+ * invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:run
*
* # A comma or space separated list of profiles to activate
- * invoker.profiles=its,jdk15
+ * invoker.profiles = its,jdk15
+ *
+ * # The path to an alternative POM or base directory to invoke Maven on, defaults to the
+ * # project that was originally specified in the plugin configuration
+ * # Since plugin version 1.4
+ * invoker.project = sub-module
*
* # The value for the environment variable MAVEN_OPTS
- * invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m
+ * invoker.mavenOpts = -Dfile.encoding=UTF-16 -Xms32m -Xmx256m
*
* # Possible values are "fail-fast" (default), "fail-at-end" and "fail-never"
- * invoker.failureBehavior=fail-never
+ * invoker.failureBehavior = fail-never
*
* # The expected result of the build, possible values are "success" (default) and "failure"
- * invoker.buildResult=failure
+ * invoker.buildResult = failure
*
* # A boolean value controlling the aggregator mode of Maven, defaults to "false"
- * invoker.nonRecursive=true
+ * invoker.nonRecursive = true
*
* # A boolean value controlling the network behavior of Maven, defaults to "false"
- * invoker.offline=true
+ * # Since plugin version 1.4
+ * invoker.offline = true
* </pre>
*
* @parameter expression="${invoker.invokerPropertiesFile}" default-value="invoker.properties"
@@ -1117,13 +1123,6 @@
request.setOutputHandler( logger );
}
- request.setBaseDirectory( basedir );
-
- if ( pomFile != null )
- {
- request.setPomFile( pomFile );
- }
-
if ( mavenHome != null )
{
invoker.setMavenHome( mavenHome );
@@ -1142,6 +1141,10 @@
break;
}
+ request.setBaseDirectory( basedir );
+
+ request.setPomFile( pomFile );
+
request.setGoals( goals );
request.setProfiles( profiles );
Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerProperties.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerProperties.java?rev=735456&r1=735455&r2=735456&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerProperties.java (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerProperties.java Sun Jan 18 05:40:12 2009
@@ -19,6 +19,7 @@
* under the License.
*/
+import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Properties;
@@ -81,6 +82,22 @@
*/
public void configureInvocation( InvocationRequest request, int index )
{
+ String project = get( "invoker.project", index );
+ if ( project != null )
+ {
+ File file = new File( request.getBaseDirectory(), project );
+ if ( file.isFile() )
+ {
+ request.setBaseDirectory( file.getParentFile() );
+ request.setPomFile( file );
+ }
+ else
+ {
+ request.setBaseDirectory( file );
+ request.setPomFile( null );
+ }
+ }
+
String goals = get( "invoker.goals", index );
if ( goals != null )
{
Modified: maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/invoker-properties.apt.vm
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/invoker-properties.apt.vm?rev=735456&r1=735455&r2=735456&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/invoker-properties.apt.vm (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/invoker-properties.apt.vm Sun Jan 18 05:40:12 2009
@@ -45,34 +45,8 @@
-------------------
There are only a few keys supported in this file and their names typically match the corresponding parameters in the
- plugin configuration. The snippet below provides a complete overview of supported properties:
-
-+----
-# A comma or space separated list of goals/phases to execute, may
-# specify an empty list to execute the default goal of the project
-invoker.goals=clean install
-
-# Optionally, a list of goals to run during further invocations of Maven
-invoker.goals.2=\${project.groupId}:\${project.artifactId}:\${project.version}:run
-
-# A comma or space separated list of profiles to activate
-invoker.profiles=its,jdk15
-
-# The value for the environment variable MAVEN_OPTS
-invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m
-
-# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never"
-invoker.failureBehavior=fail-never
-
-# The expected result of the build, possible values are "success" (default) and "failure"
-invoker.buildResult=failure
-
-# A boolean value controlling the aggregator mode of Maven, defaults to "false"
-invoker.nonRecursive=true
-
-# A boolean value controlling the network behavior of Maven, defaults to "false"
-invoker.offline=true
-+----
+ plugin configuration. For a complete overview of supported properties, see the example given in the documentation of
+ the plugin parameter <<<{{{../run-mojo.html#invokerPropertiesFile}invokerPropertiesFile}}>>>.
The comments given in the example should be rather self-explanatory. Looking closely, you can also notice that the
syntax <<<$\{expression\}>>> can be used to filter the property values. What deserves some more description is the
Modified: maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerPropertiesTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerPropertiesTest.java?rev=735456&r1=735455&r2=735456&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerPropertiesTest.java (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerPropertiesTest.java Sun Jan 18 05:40:12 2009
@@ -19,6 +19,7 @@
* under the License.
*/
+import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.Properties;
@@ -137,6 +138,37 @@
assertEquals( Arrays.asList( new String[0] ), request.getProfiles() );
}
+ public void testConfigureRequestProject()
+ throws Exception
+ {
+ Properties props = new Properties();
+ InvokerProperties facade = new InvokerProperties( props );
+
+ InvocationRequest request = new DefaultInvocationRequest();
+
+ File tempPom = File.createTempFile( "maven-invoker-plugin-test", ".pom" );
+ File tempDir = tempPom.getParentFile();
+
+ request.setBaseDirectory( tempDir );
+ facade.configureInvocation( request, 0 );
+ assertEquals( tempDir, request.getBaseDirectory() );
+ assertEquals( null, request.getPomFile() );
+
+ props.setProperty( "invoker.project", tempPom.getName() );
+ request.setBaseDirectory( tempDir );
+ facade.configureInvocation( request, 0 );
+ assertEquals( tempDir, request.getBaseDirectory() );
+ assertEquals( tempPom, request.getPomFile() );
+
+ props.setProperty( "invoker.project", "" );
+ request.setBaseDirectory( tempDir );
+ facade.configureInvocation( request, 0 );
+ assertEquals( tempDir, request.getBaseDirectory() );
+ assertEquals( null, request.getPomFile() );
+
+ tempPom.delete();
+ }
+
public void testConfigureRequestMavenOpts()
throws Exception
{