-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
70 lines (62 loc) · 2.17 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
import sbt.Keys.{libraryDependencies, resolvers}
import sbt.file
lazy val root = project
.in(file("."))
.settings(
globalSettings,
assemblySettings,
name := "spark-aggregation-framework",
version := "1.0.1",
organization := "cloud.spark",
scalaVersion := "2.12.14",
libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.26" % Provided,
libraryDependencies ++= projectDependencies // all slf4j dependencies removed
)
lazy val globalSettings = Seq(
scalacOptions ++= Seq(
"-unchecked",
"-feature",
// "-language:existential",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-deprecation",
"-encoding",
"utf8"
),
resolvers ++= Seq(
"Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository",
"Maven Repo" at "https://repo.maven.apache.org/maven2/",
//"Confluent Repo" at "https://packages.confluent.io/maven/",
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots"),
)
)
lazy val dependencies =
new {
val vTypesafeConfig = "1.2.1"
val vSpark = "3.0.1"
val vDbutils = "0.0.4"
val typesafeConfig = "com.typesafe" % "config" % vTypesafeConfig
val dbutils = "com.databricks" %% "dbutils-api" % vDbutils
val sparkCore = "org.apache.spark" %% "spark-core" % vSpark
val sparkSql = "org.apache.spark" %% "spark-sql" % vSpark
}
lazy val projectDependencies = Seq(
dependencies.typesafeConfig % Provided,
dependencies.dbutils % Provided,
dependencies.sparkCore % Provided,
dependencies.sparkSql % Provided
).map(_.exclude("org.slf4j","*")) // remove all slf4j dependencies
// define assembly jar name
lazy val fullJarName = taskKey[String]("assembly jar name")
fullJarName := s"""${name.value}_${scalaBinaryVersion.value}-${version.value}-assembly.jar"""
// Assembly Jar Settings
lazy val assemblySettings = Seq(
assemblyJarName in assembly := fullJarName.value,
assemblyMergeStrategy in assembly := {
case PathList("META-INF", xs@_*) => MergeStrategy.discard
case x => MergeStrategy.first
},
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false),
)