forked from freeacs/freeacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
258 lines (241 loc) · 8.01 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
import sbt.Keys.fork
import DebianConstants._
publishTo in ThisBuild := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))
javacOptions in ThisBuild ++= Seq("-encoding", "UTF-8")
lazy val copyAppProps = mappings in Universal ++= {
((sourceDirectory in Compile).value / "resources" * "application.properties").get.map { f =>
f -> s"config/application-config.properties"
}
}
lazy val dockerSettings = Seq(
maintainer in Docker := "Jarl Andre Hubenthal <[email protected]>",
dockerBaseImage := "openjdk:8-jdk",
dockerRepository := Some("freeacs"),
dockerUpdateLatest := true,
dockerExposedPorts := Seq(8080, 8080),
dockerExposedVolumes := Seq("/opt/docker/logs", "/opt/docker/conf")
)
lazy val packagingSettings = Seq(
defaultLinuxInstallLocation := "/opt",
daemonUser := "freeacs",
daemonGroup := "freeacs",
maintainerScripts in Debian := maintainerScriptsAppend((maintainerScripts in Debian).value)(
Conffiles ->
s"""/opt/${normalizedName.value}/config/application-config.properties
|/etc/default/${normalizedName.value}
|/lib/systemd/system/${normalizedName.value}.service
""".stripMargin,
),
rpmGroup := Some("Other"),
rpmRelease := "1",
rpmUrl := Some("https://github.com/freeacs/freeacs"),
rpmLicense := Some("The MIT License (MIT)"),
rpmVendor := "freeacs",
serviceAutostart := false
)
lazy val commonSettings = Seq(
maintainer := "Jarl Andre Hubenthal <[email protected]>",
organization := "com.github.freeacs",
scalaVersion := "2.12.6",
crossPaths := false,
resolvers += Resolver.mavenLocal,
autoScalaLibrary := false,
testOptions += Tests.Argument(TestFrameworks.JUnit),
fork in Test := true,
evictionWarningOptions in update := EvictionWarningOptions.default.withWarnTransitiveEvictions(false),
releaseUseGlobalVersion := false,
dependencyOverrides ++= Seq(
"com.zaxxer" % "HikariCP" % "3.1.0",
"commons-io" % "commons-io" % "2.4",
"org.springframework.boot" % "spring-boot-starter-web" % "2.0.2.RELEASE"
)
)
lazy val common = (project in file("common"))
.settings(
commonSettings,
name := "FreeACS Common",
normalizedName := "freeacs-common",
publish := {},
libraryDependencies ++= Dependencies.database
++ Dependencies.testing
++ List(
"org.apache.httpcomponents" % "httpclient" % "4.5.5",
"ch.qos.logback" % "logback-classic" % "1.2.3"
)
)
lazy val dbi = (project in file("dbi"))
.settings(
commonSettings,
name := "FreeACS Dbi",
normalizedName := "freeacs-dbi",
publish := {},
libraryDependencies ++= Dependencies.database
++ Dependencies.testing
++ List(
"org.jfree" % "jcommon" % "1.0.17",
"org.jfree" % "jfreechart" % "1.0.17"
)
)
.dependsOn(common)
lazy val web = (project in file("web"))
.settings(
commonSettings,
dockerSettings,
packagingSettings,
name := "FreeACS Web",
packageSummary := "FreeACS Web",
packageDescription := "FreeACS Web",
libraryDependencies ++= Dependencies.springBoot
++ Dependencies.database
++ Dependencies.testing
++ Dependencies.jdeb
++ Seq(
"org.springframework.boot" % "spring-boot-starter-security" % "2.0.2.RELEASE",
"org.springframework" % "spring-context-support" % "5.0.6.RELEASE",
"commons-fileupload" % "commons-fileupload" % "1.3",
"commons-lang" % "commons-lang" % "2.4",
"commons-httpclient" % "commons-httpclient" % "3.1",
"org.freemarker" % "freemarker" % "2.3.14",
"org.jfree" % "jcommon" % "1.0.17",
"org.jfree" % "jfreechart" % "1.0.17"
),
copyAppProps
)
.enablePlugins(JavaServerAppPackaging, SystemdPlugin, JDebPackaging, RpmPlugin)
.dependsOn(dbi)
lazy val monitor = (project in file("monitor"))
.settings(
commonSettings,
dockerSettings,
packagingSettings,
name := "FreeACS Monitor",
packageSummary := "FreeACS Monitor",
packageDescription := "FreeACS Monitor",
libraryDependencies ++= Dependencies.springBoot
++ Dependencies.database
++ Dependencies.testing
++ Dependencies.jdeb
++ Seq(
"org.freemarker" % "freemarker" % "2.3.14",
"commons-httpclient" % "commons-httpclient" % "3.1"
),
copyAppProps
)
.enablePlugins(JavaServerAppPackaging, SystemdPlugin, JDebPackaging, RpmPlugin)
.dependsOn(dbi)
lazy val webservice = (project in file("webservice"))
.settings(
commonSettings,
dockerSettings,
packagingSettings,
name := "FreeACS Webservice",
packageSummary := "FreeACS Webservice",
packageDescription := "FreeACS Webservice",
xjcCommandLine += "-verbose",
libraryDependencies ++= Dependencies.springBoot
++ Dependencies.database
++ Dependencies.testing
++ Dependencies.jdeb
++ Dependencies.springBootWebservices
++ Seq("wsdl4j" % "wsdl4j" % "1.6.3"),
copyAppProps
)
.enablePlugins(JavaServerAppPackaging, SystemdPlugin, JDebPackaging, RpmPlugin)
.dependsOn(dbi)
lazy val tr069 = (project in file("tr069"))
.settings(
commonSettings,
dockerSettings,
packagingSettings,
name := "FreeACS Tr069",
packageSummary := "FreeACS Tr069",
packageDescription := "FreeACS Tr069",
libraryDependencies ++= Dependencies.springBoot
++ Dependencies.database
++ Dependencies.testing
++ Dependencies.jdeb
++ Seq("org.apache.commons" % "commons-lang3" % "3.7"),
copyAppProps
)
.enablePlugins(JavaServerAppPackaging, SystemdPlugin, JDebPackaging, RpmPlugin)
.dependsOn(dbi)
lazy val syslog = (project in file("syslog"))
.settings(
commonSettings,
dockerSettings,
packagingSettings,
name := "FreeACS Syslog",
packageSummary := "FreeACS Syslog",
packageDescription := "FreeACS Syslog",
libraryDependencies ++= Dependencies.springBoot
++ Dependencies.database
++ Dependencies.testing
++ Dependencies.jdeb
++ List("commons-io" % "commons-io" % "1.3.2"),
copyAppProps
)
.enablePlugins(JavaServerAppPackaging, SystemdPlugin, JDebPackaging, RpmPlugin)
.dependsOn(dbi)
lazy val stun = (project in file("stun"))
.settings(
commonSettings,
dockerSettings,
packagingSettings,
name := "FreeACS Stun",
packageSummary := "FreeACS Stun",
packageDescription := "FreeACS Stun",
libraryDependencies ++= Dependencies.springBoot
++ Dependencies.database
++ Dependencies.testing
++ Dependencies.jdeb
++ List(
"org.apache.httpcomponents" % "httpclient" % "4.5.5",
"commons-io" % "commons-io" % "1.3.2"
),
copyAppProps
)
.enablePlugins(JavaServerAppPackaging, SystemdPlugin, JDebPackaging, RpmPlugin)
.dependsOn(dbi)
lazy val shell = (project in file("shell"))
.settings(
commonSettings,
dockerSettings,
packagingSettings,
name := "FreeACS Shell",
packageSummary := "FreeACS Shell",
packageDescription := "FreeACS Shell",
publish in Docker := {},
libraryDependencies ++= Dependencies.database
++ Dependencies.testing
++ Dependencies.jdeb
++ List(
"org.apache.httpcomponents" % "httpclient" % "4.5.5",
"commons-io" % "commons-io" % "1.3.2",
"jline" % "jline" % "0.9.5",
"dom4j" % "dom4j" % "1.6.1"
)
)
.enablePlugins(JavaAppPackaging, JDebPackaging, RpmPlugin)
.dependsOn(dbi)
lazy val core = (project in file("core"))
.settings(
commonSettings,
dockerSettings,
packagingSettings,
name := "FreeACS Core",
packageSummary := "FreeACS Core",
packageDescription := "FreeACS Core",
libraryDependencies ++= Dependencies.springBoot
++ Dependencies.database
++ Dependencies.testing
++ Dependencies.jdeb
++ List(
"org.apache.httpcomponents" % "httpclient" % "4.5.5",
"commons-io" % "commons-io" % "1.3.2"
),
copyAppProps
)
.enablePlugins(JavaServerAppPackaging, SystemdPlugin, JDebPackaging, RpmPlugin)
.dependsOn(shell)
lazy val root = (project in file(".") settings (publish := {}))
.aggregate(common, dbi, web, monitor, webservice, tr069, syslog, stun, shell, core)