MAven equivalent of setting spark.executor.extraClasspath during tests.

Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/ed4f6463
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/ed4f6463
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/ed4f6463

Branch: refs/heads/scala-2.11-prashant
Commit: ed4f646313b8f7224775de7072aaf4ee6c32d243
Parents: 4bcf66f
Author: Prashant Sharma <[email protected]>
Authored: Wed Nov 5 18:17:34 2014 +0530
Committer: Prashant Sharma <[email protected]>
Committed: Fri Nov 7 11:22:47 2014 +0530

----------------------------------------------------------------------
 core/pom.xml     | 17 ++++++++++-------
 examples/pom.xml | 10 ++++++++++
 pom.xml          | 46 +++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 65 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/ed4f6463/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index d71f265..37970c9 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -329,14 +329,17 @@
       <plugin>
         <groupId>org.scalatest</groupId>
         <artifactId>scalatest-maven-plugin</artifactId>
-        <configuration>
-          <environmentVariables>
-            <SPARK_HOME>${basedir}/..</SPARK_HOME>
-            <SPARK_TESTING>1</SPARK_TESTING>
-            <SPARK_CLASSPATH>${spark.classpath}</SPARK_CLASSPATH>
-          </environmentVariables>
-        </configuration>
+        <version>1.0</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <goals>
+              <goal>test</goal>
+            </goals>
+          </execution>
+        </executions>
       </plugin>
+
       <!-- Unzip py4j so we can include its files in the jar -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/spark/blob/ed4f6463/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 5f9d0b5..027745a 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -185,6 +185,16 @@
     
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
     <plugins>
       <plugin>
+        <groupId>org.codehaus.gmaven</groupId>
+        <artifactId>gmaven-plugin</artifactId>
+        <version>1.4</version>
+        <executions>
+          <execution>
+            <phase>none</phase>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-deploy-plugin</artifactId>
         <configuration>

http://git-wip-us.apache.org/repos/asf/spark/blob/ed4f6463/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1bd4970..b239356 100644
--- a/pom.xml
+++ b/pom.xml
@@ -142,9 +142,13 @@
     <aws.kinesis.client.version>1.1.0</aws.kinesis.client.version>
     <commons.httpclient.version>4.2.6</commons.httpclient.version>
     <commons.math3.version>3.1.1</commons.math3.version>
-
+    
<test_classpath_file>${project.build.directory}/spark-test-classpath.txt</test_classpath_file>
     <PermGen>64m</PermGen>
     <MaxPermGen>512m</MaxPermGen>
+    <scala.version>2.10.4</scala.version>
+    <scala.binary.version>2.10</scala.binary.version>
+    <jline.version>${scala.version}</jline.version>
+    <jline.groupid>org.scala-lang</jline.groupid>
   </properties>
 
   <repositories>
@@ -961,6 +965,7 @@
               
<spark.test.home>${session.executionRootDirectory}</spark.test.home>
               <spark.testing>1</spark.testing>
               <spark.ui.enabled>false</spark.ui.enabled>
+              
<spark.executor.extraClassPath>${test_classpath}</spark.executor.extraClassPath>
             </systemProperties>
           </configuration>
           <executions>
@@ -1022,6 +1027,45 @@
     </pluginManagement>
 
     <plugins>
+      <!-- This plugin dumps the test classpath into a file -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.9</version>
+        <executions>
+          <execution>
+            <phase>test-compile</phase>
+            <goals>
+              <goal>build-classpath</goal>
+            </goals>
+            <configuration>
+              <includeScope>test</includeScope>
+              <outputFile>${test_classpath_file}</outputFile>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
+      <!-- This plugin reads a file into maven property. And it lets us write 
groovy !! -->
+      <plugin>
+        <groupId>org.codehaus.gmaven</groupId>
+        <artifactId>gmaven-plugin</artifactId>
+        <version>1.4</version>
+        <executions>
+          <execution>
+            <phase>process-test-classes</phase>
+            <goals>
+              <goal>execute</goal>
+            </goals>
+            <configuration>
+              <source>
+                def file = new File(project.properties.test_classpath_file)
+                project.properties.test_classpath = 
file.getText().split().join(":")
+              </source>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
       <!-- The shade plug-in is used here to create effective pom's (see 
SPARK-3812). -->
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to