File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
src/main/java/org/apache/spark/launcher Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 42
42
<artifactId >log4j</artifactId >
43
43
<scope >test</scope >
44
44
</dependency >
45
+ <dependency >
46
+ <groupId >junit</groupId >
47
+ <artifactId >junit</artifactId >
48
+ <scope >test</scope >
49
+ </dependency >
45
50
<dependency >
46
51
<groupId >org.mockito</groupId >
47
52
<artifactId >mockito-all</artifactId >
62
67
<artifactId >slf4j-log4j12</artifactId >
63
68
<scope >test</scope >
64
69
</dependency >
70
+
71
+ <!-- Not needed by the test code, but referenced by SparkSubmit which is used by the tests. -->
72
+ <dependency >
73
+ <groupId >org.apache.hadoop</groupId >
74
+ <artifactId >hadoop-client</artifactId >
75
+ <scope >test</scope >
76
+ </dependency >
65
77
</dependencies >
66
78
67
79
<build >
68
80
<outputDirectory >target/scala-${scala.binary.version} /classes</outputDirectory >
69
81
<testOutputDirectory >target/scala-${scala.binary.version} /test-classes</testOutputDirectory >
70
82
<plugins >
83
+ <plugin >
84
+ <groupId >org.apache.maven.plugins</groupId >
85
+ <artifactId >maven-jar-plugin</artifactId >
86
+ <configuration >
87
+ <outputDirectory >target/scala-${scala.binary.version} </outputDirectory >
88
+ </configuration >
89
+ </plugin >
71
90
<plugin >
72
91
<groupId >org.scalatest</groupId >
73
92
<artifactId >scalatest-maven-plugin</artifactId >
Original file line number Diff line number Diff line change @@ -275,6 +275,7 @@ protected List<String> buildClassPath(String appClassPath) throws IOException {
275
275
276
276
addToClassPath (cp , getenv ("HADOOP_CONF_DIR" ));
277
277
addToClassPath (cp , getenv ("YARN_CONF_DIR" ));
278
+ addToClassPath (cp , getenv ("SPARK_DIST_CLASSPATH" ));
278
279
return cp ;
279
280
}
280
281
@@ -511,7 +512,7 @@ public boolean accept(File file) {
511
512
}
512
513
513
514
private String getenv (String key ) {
514
- return (env != null ) ? env .get (key ) : System .getenv (key );
515
+ return first (env != null ? env .get (key ) : null , System .getenv (key ) );
515
516
}
516
517
517
518
/**
Original file line number Diff line number Diff line change 1122
1122
</includes >
1123
1123
<reportsDirectory >${project.build.directory} /surefire-reports</reportsDirectory >
1124
1124
<argLine >-Xmx3g -XX:MaxPermSize=${MaxPermGen} -XX:ReservedCodeCacheSize=512m</argLine >
1125
+ <environmentVariables >
1126
+ <!--
1127
+ Setting SPARK_DIST_CLASSPATH is a simple way to make sure any child processes
1128
+ launched by the tests have access to the correct test-time classpath.
1129
+ -->
1130
+ <SPARK_DIST_CLASSPATH >${test_classpath} </SPARK_DIST_CLASSPATH >
1131
+ </environmentVariables >
1125
1132
<systemProperties >
1126
1133
<java .awt.headless>true</java .awt.headless>
1127
1134
<spark .test.home>${session.executionRootDirectory} </spark .test.home>
1128
1135
<spark .testing>1</spark .testing>
1129
1136
<spark .ui.enabled>false</spark .ui.enabled>
1130
1137
<spark .ui.showConsoleProgress>false</spark .ui.showConsoleProgress>
1131
- <spark .executor.extraClassPath>${test_classpath} </spark .executor.extraClassPath>
1132
1138
<spark .driver.allowMultipleContexts>true</spark .driver.allowMultipleContexts>
1133
1139
</systemProperties >
1134
1140
</configuration >
You can’t perform that action at this time.
0 commit comments