-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
79 lines (56 loc) · 2.18 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
import com.typesafe.sbt.packager.docker.{Cmd, ExecCmd}
name := """daf-vanilla-microservice"""
version := "1.0.0-SNAPSHOT"
val isStaging = System.getProperty("STAGING") != null
lazy val root = (project in file(".")).enablePlugins(PlayJava, DockerPlugin)
scalaVersion := "2.12.2"
val playLibraries = Seq(
"org.pac4j" %% "play-pac4j" % "6.0.0",
"org.pac4j" % "pac4j-http" % "3.0.0",
"org.pac4j" % "pac4j-jwt" % "3.0.0" exclude("commons-io", "commons-io"),
"org.pac4j" % "pac4j-ldap" % "3.0.0"
)
libraryDependencies += "org.webjars" % "swagger-ui" % "3.1.5"
libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final"
libraryDependencies += guice
libraryDependencies ++= playLibraries
val sopts = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-target:jvm-1.8",
"-unchecked",
"-Ywarn-adapted-args",
"-Ywarn-numeric-widen",
"-Ywarn-unused",
"-Xfuture",
"-Xlint",
"-no-java-comments"
)
val soptsNoTest = Seq(
"-Ywarn-dead-code",
"-Ywarn-value-discard"
)
scalacOptions in (Compile, doc) ++= sopts ++ soptsNoTest
scalacOptions in Test ++= sopts
//dockerBaseImage := "anapsix/alpine-java:8_jdk_unlimited"
dockerBaseImage := "openjdk:8u171-jdk-slim"
//dockerCommands := dockerCommands.value.flatMap {
// case cmd@Cmd("FROM", _) => List(cmd,
// Cmd("RUN", "apk update && apk add bash krb5-libs krb5"),
// Cmd("RUN", "ln -sf /etc/krb5.conf /opt/jdk/jre/lib/security/krb5.conf")
// )
// case other => List(other)
//}
dockerExposedPorts := Seq(9000)
dockerEntrypoint := {Seq(s"bin/${name.value}", "-Dconfig.file=conf/application.conf")}
dockerRepository := { if(isStaging)Option("nexus.teamdigitale.test") else Option("nexus.daf.teamdigitale.it") }
publishTo in ThisBuild := {
val nexus = if(isStaging) "http://nexus.teamdigitale.test:8081/repository/"
else "http://nexus.daf.teamdigitale.it:8081/repository/"
if (isSnapshot.value)
Some("snapshots" at nexus + "maven-snapshots/")
else
Some("releases" at nexus + "maven-releases/")
}
credentials += {if(isStaging) Credentials(Path.userHome / ".ivy2" / ".credentialsTest") else Credentials(Path.userHome / ".ivy2" / ".credentials")}