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 2010/09/04 22:17:55 UTC

svn commit: r992668 - /maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/

Author: bentmann
Date: Sat Sep  4 20:17:55 2010
New Revision: 992668

URL: http://svn.apache.org/viewvc?rev=992668&view=rev
Log:
o Extended IT plugin to allow distinction of multiple executions

Modified:
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileRuntimeMojo.java
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java
    maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java?rev=992668&r1=992667&r2=992668&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java Sat Sep  4 20:17:55 2010
@@ -333,6 +333,12 @@ public abstract class AbstractDependency
 
         if ( pathname != null )
         {
+            if ( pathname.indexOf( "@idx@" ) >= 0 )
+            {
+                // helps to distinguished forked executions of the same mojo
+                pathname = pathname.replaceAll( "@idx@", String.valueOf( nextCounter() ) );
+            }
+
             file = new File( pathname );
 
             if ( !file.isAbsolute() )
@@ -344,4 +350,19 @@ public abstract class AbstractDependency
         return file;
     }
 
+    private int nextCounter()
+    {
+        int counter = 0;
+
+        String key = getClass().getName();
+
+        synchronized ( System.class )
+        {
+            counter = Integer.getInteger( key, 0 ).intValue();
+            System.setProperty( key, Integer.toString( counter + 1 ) );
+        }
+
+        return counter;
+    }
+
 }

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java?rev=992668&r1=992667&r2=992668&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java Sat Sep  4 20:17:55 2010
@@ -23,7 +23,9 @@ import org.apache.maven.artifact.Depende
 import org.apache.maven.plugin.MojoExecutionException;
 
 /**
- * Creates text files that list the dependencies with scope compile in the order returned from the Maven core.
+ * Creates text files that list the dependencies with scope compile in the order returned from the Maven core. The path
+ * parameters of this mojo support the token <code>&#64;idx&#64;</code> to dynamically insert a running index in order
+ * to distinguish multiple executions of the same mojo.
  * 
  * @goal compile
  * @requiresDependencyResolution compile

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileRuntimeMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileRuntimeMojo.java?rev=992668&r1=992667&r2=992668&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileRuntimeMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileRuntimeMojo.java Sat Sep  4 20:17:55 2010
@@ -24,7 +24,8 @@ import org.apache.maven.plugin.MojoExecu
 
 /**
  * Creates text files that list the dependencies with scope compile and runtime in the order returned from the Maven
- * core.
+ * core. The path parameters of this mojo support the token <code>&#64;idx&#64;</code> to dynamically insert a running
+ * index in order to distinguish multiple executions of the same mojo.
  * 
  * @goal compile-runtime
  * @requiresDependencyResolution compile+runtime

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java?rev=992668&r1=992667&r2=992668&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java Sat Sep  4 20:17:55 2010
@@ -23,7 +23,9 @@ import org.apache.maven.artifact.Depende
 import org.apache.maven.plugin.MojoExecutionException;
 
 /**
- * Creates text files that list the dependencies with scope runtime in the order returned from the Maven core.
+ * Creates text files that list the dependencies with scope runtime in the order returned from the Maven core. The path
+ * parameters of this mojo support the token <code>&#64;idx&#64;</code> to dynamically insert a running index in order
+ * to distinguish multiple executions of the same mojo.
  * 
  * @goal runtime
  * @requiresDependencyResolution runtime

Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java?rev=992668&r1=992667&r2=992668&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java Sat Sep  4 20:17:55 2010
@@ -23,7 +23,9 @@ import org.apache.maven.artifact.Depende
 import org.apache.maven.plugin.MojoExecutionException;
 
 /**
- * Creates text files that list the dependencies with scope test in the order returned from the Maven core.
+ * Creates text files that list the dependencies with scope test in the order returned from the Maven core. The path
+ * parameters of this mojo support the token <code>&#64;idx&#64;</code> to dynamically insert a running index in order
+ * to distinguish multiple executions of the same mojo.
  * 
  * @goal test
  * @requiresDependencyResolution test