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 15:07:10 UTC
svn commit: r735459 - in /maven/plugins/trunk/maven-invoker-plugin/src:
it/invocation-project/src/it/project/invoker.properties
main/java/org/apache/maven/plugin/invoker/InvokerProperties.java
site/apt/examples/invoker-properties.apt.vm
Author: bentmann
Date: Sun Jan 18 06:07:10 2009
New Revision: 735459
URL: http://svn.apache.org/viewvc?rev=735459&view=rev
Log:
[MINVOKER-75] Trigger further builds upon any indexed invoker property
Modified:
maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties
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
Modified: 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=735459&r1=735458&r2=735459&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/invocation-project/src/it/project/invoker.properties Sun Jan 18 06:07:10 2009
@@ -1,6 +1,5 @@
# path to POM
-invoker.project = sub-1/pom.xml
+invoker.project.1 = sub-1/pom.xml
# path to base directory
invoker.project.2 = sub-3
-invoker.goals.2 = clean
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=735459&r1=735458&r2=735459&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 06:07:10 2009
@@ -42,6 +42,41 @@
private final Properties properties;
/**
+ * The constant for the invoker property.
+ */
+ private static final String PROJECT = "invoker.project";
+
+ /**
+ * The constant for the invoker property.
+ */
+ private static final String GOALS = "invoker.goals";
+
+ /**
+ * The constant for the invoker property.
+ */
+ private static final String PROFILES = "invoker.profiles";
+
+ /**
+ * The constant for the invoker property.
+ */
+ private static final String MAVEN_OPTS = "invoker.mavenOpts";
+
+ /**
+ * The constant for the invoker property.
+ */
+ private static final String FAILURE_BEHAVIOR = "invoker.failureBehavior";
+
+ /**
+ * The constant for the invoker property.
+ */
+ private static final String NON_RECURSIVE = "invoker.nonRecursive";
+
+ /**
+ * The constant for the invoker property.
+ */
+ private static final String OFFLINE = "invoker.offline";
+
+ /**
* Creates a new facade for the specified invoker properties. The properties will not be copied, so any changes to
* them will be reflected by the facade.
*
@@ -70,7 +105,15 @@
*/
public boolean isInvocationDefined( int index )
{
- return properties.getProperty( "invoker.goals." + index ) != null;
+ String[] keys = { PROJECT, GOALS, PROFILES, MAVEN_OPTS, FAILURE_BEHAVIOR, NON_RECURSIVE, OFFLINE };
+ for ( int i = 0; i < keys.length; i++ )
+ {
+ if ( properties.getProperty( keys[i] + '.' + index ) != null )
+ {
+ return true;
+ }
+ }
+ return false;
}
/**
@@ -82,7 +125,7 @@
*/
public void configureInvocation( InvocationRequest request, int index )
{
- String project = get( "invoker.project", index );
+ String project = get( PROJECT, index );
if ( project != null )
{
File file = new File( request.getBaseDirectory(), project );
@@ -98,37 +141,37 @@
}
}
- String goals = get( "invoker.goals", index );
+ String goals = get( GOALS, index );
if ( goals != null )
{
request.setGoals( new ArrayList( Arrays.asList( StringUtils.split( goals, ", \t\n\r\f" ) ) ) );
}
- String profiles = get( "invoker.profiles", index );
+ String profiles = get( PROFILES, index );
if ( profiles != null )
{
request.setProfiles( new ArrayList( Arrays.asList( StringUtils.split( profiles, ", \t\n\r\f" ) ) ) );
}
- String mvnOpts = get( "invoker.mavenOpts", index );
+ String mvnOpts = get( MAVEN_OPTS, index );
if ( mvnOpts != null )
{
request.setMavenOpts( mvnOpts );
}
- String failureBehavior = get( "invoker.failureBehavior", index );
+ String failureBehavior = get( FAILURE_BEHAVIOR, index );
if ( failureBehavior != null )
{
request.setFailureBehavior( failureBehavior );
}
- String nonRecursive = get( "invoker.nonRecursive", index );
+ String nonRecursive = get( NON_RECURSIVE, index );
if ( nonRecursive != null )
{
request.setRecursive( !Boolean.valueOf( nonRecursive ).booleanValue() );
}
- String offline = get( "invoker.offline", index );
+ String offline = get( OFFLINE, index );
if ( offline != null )
{
request.setOffline( Boolean.valueOf( offline ).booleanValue() );
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=735459&r1=735458&r2=735459&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 06:07:10 2009
@@ -83,4 +83,4 @@
All the properties can be indexed this way, e.g. <<<invoker.profiles.3>>> would specify the profiles to use for the
third invocation. If the property <<<invoker.profiles.3>>> was not defined, the plugin would query the property
<<<invoker.profiles>>> as a fallback to determine the profiles for the third build. This build loop ends after
- invocation <i> if the property <<<invoker.goals.>>><i+1> is undefined.
+ invocation <i> if no property <<<invoker.*.>>><i+1> is defined.