From 3c709cf3d1dcc14adf4daec8774448aefef970f3 Mon Sep 17 00:00:00 2001 From: Piotr Kolaczkowski Date: Tue, 19 Apr 2016 14:08:44 +0200 Subject: [PATCH] SPARKC-355: Shade Guava and Netty, remove Apache Commons. --- project/Settings.scala | 7 +++++++ project/SparkCassandraConnectorBuild.scala | 3 +-- project/plugins.sbt | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/project/Settings.scala b/project/Settings.scala index 4fdda3664..d93a8502b 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -344,6 +344,13 @@ object Settings extends Build { case PathList("META-INF", xs @ _*) => MergeStrategy.last case x => old(x) } + }, + assemblyShadeRules in assembly := { + val shadePackage = "shade.com.datastax.spark.connector" + Seq( + ShadeRule.rename("com.google.common.**" -> s"$shadePackage.google.common.@1").inAll, + ShadeRule.rename("io.netty.**" -> s"$shadePackage.netty.@1").inAll + ) } ) diff --git a/project/SparkCassandraConnectorBuild.scala b/project/SparkCassandraConnectorBuild.scala index 8eb975ae0..ce1978d37 100644 --- a/project/SparkCassandraConnectorBuild.scala +++ b/project/SparkCassandraConnectorBuild.scala @@ -166,7 +166,6 @@ object Artifacts { val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % Akka % "provided" // ApacheV2 val cassandraClient = "org.apache.cassandra" % "cassandra-clientutil" % Settings.cassandraTestVersion guavaExclude // ApacheV2 val cassandraDriver = "com.datastax.cassandra" % "cassandra-driver-core" % CassandraDriver guavaExclude // ApacheV2 - val commonsLang3 = "org.apache.commons" % "commons-lang3" % CommonsLang3 // ApacheV2 val config = "com.typesafe" % "config" % Config % "provided" // ApacheV2 val guava = "com.google.guava" % "guava" % Guava val jodaC = "org.joda" % "joda-convert" % JodaC @@ -264,7 +263,7 @@ object Dependencies { val spark = Seq(sparkCore, sparkStreaming, sparkSql, sparkCatalyst, sparkHive, sparkUnsafe) val connector = testKit ++ metrics ++ jetty ++ logging ++ akka ++ cassandra ++ spark.map(_ % "provided") ++ Seq( - commonsLang3, config, guava, jodaC, jodaT, lzf, jsr166e) + config, guava, jodaC, jodaT, lzf, jsr166e) val embedded = logging ++ spark ++ cassandra ++ Seq( cassandraServer % "it,test", Embedded.jopt, Embedded.sparkRepl, Embedded.kafka, Embedded.snappy, guava) diff --git a/project/plugins.sbt b/project/plugins.sbt index c14bced41..abcc86ea7 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -21,4 +21,6 @@ resolvers += "Spark Packages Main repo" at "https://dl.bintray.com/spark-package addSbtPlugin("org.spark-packages" %% "sbt-spark-package" % "0.2.3") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.6") \ No newline at end of file +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.6") + +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")