forked from marcodippy/lambda_poc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
73 lines (59 loc) · 2.63 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
lazy val commonSettings = Seq(
organization := "org.mdipaola",
version := "0.1.0",
scalaVersion := "2.11.7"
)
val avro_version = "1.8.0"
val cassandra_driver_core_version = "3.0.0-rc1"
val spark_version = "1.6.0"
val spark_avro_version = "2.0.1"
val spark_cassandra_connector_version = "1.5.0-RC1"
val spray_verison = "1.3.1"
val slf4j_version = "1.7.14"
val avroExclusion = ExclusionRule(organization = "org.apache.avro")
val jlineExclusion = ExclusionRule("jline", "jline")
val scalaExclusion = ExclusionRule(organization = "org.scala-lang")
val slf4jExclusion = ExclusionRule("org.slf4j", "slf4j-api")
val sparkExclusion = ExclusionRule(organization = "org.apache.spark")
lazy val provided_dependencies = Seq(
"org.apache.spark" %% "spark-streaming" % spark_version excludeAll (scalaExclusion),
"org.apache.spark" %% "spark-sql" % spark_version excludeAll (scalaExclusion),
"org.apache.spark" %% "spark-core" % spark_version excludeAll (scalaExclusion)
)
val dependencies = Seq(
"org.apache.spark" %% "spark-streaming-kafka" % spark_version,
"com.datastax.spark" %% "spark-cassandra-connector" % spark_cassandra_connector_version excludeAll (sparkExclusion),
"com.databricks" %% "spark-avro" % spark_avro_version,
"org.apache.avro" % "avro" % avro_version,
"io.spray" %% "spray-can" % spray_verison,
"io.spray" %% "spray-routing" % spray_verison,
"io.spray" %% "spray-json" % spray_verison
)
lazy val root = (project in file(".")).
settings(commonSettings: _*).
settings(name := "lambda_poc").
settings(
libraryDependencies ++= (provided_dependencies.map(_ % "provided") ++ dependencies)
)
lazy val mainRunner = (project in file("mainRunner")).
dependsOn(RootProject(file("."))).
settings(commonSettings: _*).
settings(
libraryDependencies ++= (provided_dependencies.map(_ % "compile"))
)
/****************************************************************************/
/**************************** ASSEMBLY PLUGIN *******************************/
/****************************************************************************/
assemblyJarName in assembly := "lambda_poc-uber.jar"
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs@_*) => {
(xs map { _.toLowerCase }) match {
case ("manifest.mf" :: Nil) | ("index.list" :: Nil) | ("dependencies" :: Nil) => MergeStrategy.discard
case _ => MergeStrategy.discard
}
}
case PathList("reference.conf", xs@_*) => MergeStrategy.concat
case PathList(ps @ _*) if ps.contains("spray") => MergeStrategy.discard
case _ => MergeStrategy.first
}
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)