-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
66 lines (55 loc) · 2.16 KB
/
build.sbt
File metadata and controls
66 lines (55 loc) · 2.16 KB
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
resolvers in ThisBuild ++= Seq(
Resolver.mavenLocal,
//"Local Maven" at Path.userHome.asFile.toURI.toURL + ".m2/repository",
"Apache Development Snapshot Repository" at "https://repository.apache.org/content/repositories/snapshots/",
"mvnrepostory" at "https://mvnrepository.com"
)
name := "news"
version := "0.1-SNAPSHOT"
organization := "com.dag"
scalaVersion in ThisBuild := "2.11.8"
val flinkVersion = "1.4.2"
libraryDependencies ++= Seq(
"com.rometools" % "rome" % "1.9.1-SNAPSHOT" % "compile",
"org.apache.httpcomponents" % "httpclient" % "4.5" % "compile",
"org.slf4j" % "slf4j-log4j12" % "1.7.6" % "compile",
// "log4j" % "log4j" % "1.2.17" % "compile",
"com.h2database" % "h2" % "1.4.196" % "compile"
)
val flinkDependencies = Seq(
"org.apache.flink" %% "flink-scala" % flinkVersion % "provided",
"org.apache.flink" %% "flink-streaming-scala" % flinkVersion % "provided"
)
lazy val root = (project in file(".")).
settings(
libraryDependencies ++= flinkDependencies
)
mainClass in assembly := Some("com.dag.Job")
// make run command include the provided dependencies
run in Compile := Defaults.runTask(fullClasspath in Compile,
mainClass in(Compile, run),
runner in(Compile, run)
).evaluated
// exclude Scala library from assembly
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)
assemblyMergeStrategy in assembly := {
case x if x.endsWith(".class") => MergeStrategy.last
case x if x.endsWith(".properties") => MergeStrategy.last
case x if x.contains("/resources/") => MergeStrategy.last
case x if x.startsWith("META-INF/mailcap") => MergeStrategy.last
case x if x.startsWith("META-INF/mimetypes.default") => MergeStrategy.first
case x if x.startsWith("META-INF/maven/org.slf4j/slf4j-api/pom.") => MergeStrategy.first
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
if (oldStrategy == MergeStrategy.deduplicate)
MergeStrategy.first
else
oldStrategy(x)
}
// this jar caused issues so I just exclude it completely
assemblyExcludedJars in assembly := {
val cp = (fullClasspath in assembly).value
cp filter {
_.data.getName contains "kkkkk"
}
}