aboutsummaryrefslogtreecommitdiff
path: root/pom.xml
diff options
context:
space:
mode:
authorMarcelo Vanzin <vanzin@cloudera.com>2014-08-20 16:23:10 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-08-20 16:23:10 -0700
commitc9f743957fa963bc1dbed7a44a346ffce1a45cf2 (patch)
tree11700155aa14aa3c913a104fa36e6f78b599c741 /pom.xml
parentd9e94146a6e65be110a62e3bd0351148912a41d1 (diff)
downloadspark-c9f743957fa963bc1dbed7a44a346ffce1a45cf2.tar.gz
spark-c9f743957fa963bc1dbed7a44a346ffce1a45cf2.tar.bz2
spark-c9f743957fa963bc1dbed7a44a346ffce1a45cf2.zip
[SPARK-2848] Shade Guava in uber-jars.
For further discussion, please check the JIRA entry. This change moves Guava classes to a different package so that they don't conflict with the user-provided Guava (or the Hadoop-provided one). Since one class (Optional) was exposed through Spark's public API, that class was forked from Guava at the current dependency version (14.0.1) so that it can be kept going forward (until the API is cleaned). Note this change has a few implications: - *all* classes in the final jars will reference the relocated classes. If Hadoop classes are included (i.e. "-Phadoop-provided" is not activated), those will also reference the Guava 14 classes (instead of the Guava 11 classes from the Hadoop classpath). - if the Guava version in Spark is ever changed, the new Guava will still reference the forked Optional class; this may or may not be a problem, but in the long term it's better to think about removing Optional from the public API. For the end user, there are two visible implications: - Guava is not provided as a transitive dependency anymore (since it's "provided" in Spark) - At runtime, unless they provide their own, they'll either have no Guava or Hadoop's version of Guava (11), depending on how they set up their classpath. Note that this patch does not change the sbt deliverables; those will still contain guava in its original package, and provide guava as a compile-time dependency. This assumes that maven is the canonical build, and sbt-built artifacts are not (officially) published. Author: Marcelo Vanzin <vanzin@cloudera.com> Closes #1813 from vanzin/SPARK-2848 and squashes the following commits: 9bdffb0 [Marcelo Vanzin] Undo sbt build changes. 819b445 [Marcelo Vanzin] Review feedback. 05e0a3d [Marcelo Vanzin] Merge branch 'master' into SPARK-2848 fef4370 [Marcelo Vanzin] Unfork Optional.java. d3ea8e1 [Marcelo Vanzin] Exclude asm classes from final jar. 637189b [Marcelo Vanzin] Add hacky filter to prefer Spark's copy of Optional. 2fec990 [Marcelo Vanzin] Shade Guava in the sbt build. 616998e [Marcelo Vanzin] Shade Guava in the maven build, fork Guava's Optional.java.
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml16
1 files changed, 16 insertions, 0 deletions
diff --git a/pom.xml b/pom.xml
index 7ed07ad7df..9cbf3ea599 100644
--- a/pom.xml
+++ b/pom.xml
@@ -260,6 +260,7 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>14.0.1</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -1017,6 +1018,21 @@
<profiles>
+ <!--
+ This profile is enabled automatically by the sbt built. It changes the scope for the guava
+ dependency, since we don't shade it in the artifacts generated by the sbt build.
+ -->
+ <profile>
+ <id>sbt</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+
<!-- Ganglia integration is not included by default due to LGPL-licensed code -->
<profile>
<id>spark-ganglia-lgpl</id>