-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
98 lines (92 loc) · 3.74 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import com.earldouglas.xwp.JettyPlugin
import com.mojolly.scalate.ScalatePlugin.ScalateKeys._
import com.mojolly.scalate.ScalatePlugin._
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging
import org.scalatra.sbt._
import sbt.Keys._
import sbt._
/*
* Dependencies
*/
val testDependencies = Seq(
"org.slf4j" % "slf4j-simple" % "1.7.21" % "test",
"junit" % "junit" % "4.11" % "test",
"org.scalatest" % "scalatest_2.10" % "2.2.6" % "test"
)
/*
* Properties
*/
val ScalatraVersion = "2.4.1"
/*
* Settings
*/
lazy val commonSettings = Seq(
organization := "HTW Berlin",
name := "WikiPlag",
version := "0.0.1",
scalacOptions ++= Seq("-encoding", "UTF-8"),
scalaVersion := "2.10.4",
libraryDependencies ++= testDependencies
)
unmanagedBase <<= baseDirectory { base => base / "libs" }
val meta = """META.INF(.)*""".r
assemblyMergeStrategy in assembly := {
case PathList("javax", "servlet", xs @ _*) => MergeStrategy.first
case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.first
case n if n.startsWith("reference.conf") => MergeStrategy.concat // very important for scalatra
case n if n.endsWith(".conf") => MergeStrategy.concat
case meta(_) => MergeStrategy.discard
case x => MergeStrategy.first
}
lazy val root = (project in file("."))
.settings(ScalatraPlugin.scalatraSettings: _*)
.settings(scalateSettings: _*)
.settings(commonSettings: _*)
.settings(
resolvers += Classpaths.typesafeReleases,
resolvers += "Scalaz Bintray Repo" at "http://dl.bintray.com/scalaz/releases",
resolvers += "jitpack" at "https://jitpack.io",
libraryDependencies ++= Seq(
"org.mongodb" %% "casbah" % "3.1.1",
"org.scalatra" %% "scalatra" % ScalatraVersion,
"org.scalatra" %% "scalatra-scalate" % ScalatraVersion,
"org.scalatra" %% "scalatra-specs2" % ScalatraVersion % "test",
"ch.qos.logback" % "logback-classic" % "1.1.5" % "runtime",
"org.eclipse.jetty" % "jetty-webapp" % "9.2.15.v20160210" % "compile;container",
"javax.servlet" % "javax.servlet-api" % "3.1.0" % "container;provided",
"org.scalatra" %% "scalatra-json" % ScalatraVersion,
"org.json4s" %% "json4s-jackson" % "3.3.0",
"org.scalaj" %% "scalaj-http" % "2.3.0",
"com.typesafe" % "config" % "1.2.1",
"commons-codec" % "commons-codec" % "1.9" % "provided",
// "org.apache.spark" %% "spark-core" % "1.5.0" % "provided"
("org.apache.spark" %% "spark-core" % "1.5.0")
// .exclude("org.eclipse.jetty.orbit", "javax.servlet")
// .exclude("org.eclipse.jetty.orbit", "javax.transaction")
// .exclude("org.eclipse.jetty.orbit", "javax.mail")
// .exclude("org.eclipse.jetty.orbit", "javax.activation")
// .exclude("commons-beanutils", "commons-beanutils-core")
// .exclude("commons-collections", "commons-collections")
// .exclude("com.esotericsoftware.minlog", "minlog")
// // 'sbt package' with these project and place them into at /libs
// "com.github.WikiPlag" % "analyzer" % "-SNAPSHOT",
// "com.github.WikiPlag" % "wikiplag_utils" % "-SNAPSHOT"
),
// https://github.com/FasterXML/jackson-module-scala/issues/214
dependencyOverrides += "com.fasterxml.jackson.module" % "jackson-module-scala_2.10" % "2.4.4",
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.4.4",
scalateTemplateConfig in Compile <<= (sourceDirectory in Compile) { base =>
Seq(
TemplateConfig(
base / "webapp" / "WEB-INF" / "templates",
Seq.empty, /* default imports should be added here */
Seq(
Binding("context", "_root_.org.scalatra.scalate.ScalatraRenderContext", importMembers = true, isImplicit = true)
), /* add extra bindings here */
Some("templates")
)
)
}
)
.enablePlugins(JettyPlugin)
.enablePlugins(JavaAppPackaging)