Skip to content

Commit 819b445

Browse files
author
Marcelo Vanzin
committed
Review feedback.
1 parent 05e0a3d commit 819b445

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

core/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@
345345
</includes>
346346
</artifactSet>
347347
<filters>
348+
<!-- See comment in the guava dependency declaration above. -->
348349
<filter>
349350
<artifact>com.google.guava:guava</artifact>
350351
<includes>

project/SparkBuild.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ object Assembly {
289289

290290
}
291291

292+
/**
293+
* Settings for the spark-core artifact. We don't want to expose Guava as a compile-time dependency,
294+
* but at the same time the Java API exposes a Guava type (Optional). So we package it with the
295+
* spark-core jar using the assembly plugin, and use the assembly deliverable as the main artifact
296+
* for that project, disabling the non-assembly jar.
297+
*/
292298
object CoreAssembly {
293299
import sbtassembly.Plugin._
294300
import AssemblyKeys._
@@ -304,8 +310,8 @@ object CoreAssembly {
304310
cp filter {!_.data.getName.startsWith("guava")}
305311
},
306312
mergeStrategy in assembly := {
307-
case PathList("com", "google", "common", xs @ _*) =>
308-
if (xs.size == 2 && xs(0) == "base" && xs(1).startsWith("Optional")) {
313+
case PathList("com", "google", "common", "base", xs @ _*) =>
314+
if (xs.size == 1 && xs(0).startsWith("Optional")) {
309315
MergeStrategy.first
310316
} else {
311317
MergeStrategy.discard

0 commit comments

Comments
 (0)