@@ -96,19 +96,19 @@ object Dependencies {
96
96
" org.yaml" % " snakeyaml" % " 1.26"
97
97
)
98
98
99
- lazy val PactTestConfig = config(" PactTest" ) extend(Test )
99
+ lazy val PactTestConfig = config(" PactTest" ) extend (Test )
100
100
lazy val PactSettings : Seq [Def .Setting [_]] = inConfig(PactTestConfig )(Defaults .testTasks) ++ Seq (
101
101
// Since pactTest gets its options from Test configuration, the 'Test' (default) config won't run PactProviderTests
102
102
// To run all tests use pact config 'sbt PactTest/test' (or 'sbt article_api/PactTest/test' for a single subproject)
103
103
Test / testOptions := Seq (Tests .Argument (" -l" , " PactProviderTest" )),
104
104
Test / testOnly / testOptions := Seq (Tests .Argument (" -l" , " PactProviderTest" )),
105
-
106
105
PactTestConfig / testOptions := Seq .empty,
107
106
PactTestConfig / testOnly / testOptions := Seq .empty
108
107
)
109
108
110
- lazy val assemblySettings = Seq (
109
+ def assemblySettings ( assemblyMainClass : String ) = Seq (
111
110
assembly / assemblyJarName := name.value + " .jar" ,
111
+ assembly / mainClass := Some (assemblyMainClass),
112
112
assembly / assemblyMergeStrategy := {
113
113
case " module-info.class" => MergeStrategy .discard
114
114
case x if x.endsWith(" /module-info.class" ) => MergeStrategy .discard
@@ -140,13 +140,13 @@ object Dependencies {
140
140
from(" adoptopenjdk/openjdk11:alpine-slim" )
141
141
run(" apk" , " --no-cache" , " add" , " ttf-dejavu" )
142
142
add(artifact, artifactTargetPath)
143
- entryPoint(entry:_* )
143
+ entryPoint(entry : _* )
144
144
}
145
145
},
146
146
docker / imageNames := Seq (
147
147
ImageName (namespace = Some (organization.value),
148
- repository = name.value,
149
- tag = Some (System .getProperty(" docker.tag" , " SNAPSHOT" )))
148
+ repository = name.value,
149
+ tag = Some (System .getProperty(" docker.tag" , " SNAPSHOT" )))
150
150
)
151
151
)
152
152
}
@@ -156,6 +156,7 @@ object Dependencies {
156
156
import common ._
157
157
158
158
object articleapi {
159
+ lazy val mainClass = " no.ndla.articleapi.JettyLauncher"
159
160
lazy val dependencies : Seq [ModuleID ] = Seq (
160
161
ndlaLanguage,
161
162
ndlaNetwork,
@@ -209,7 +210,7 @@ object Dependencies {
209
210
val settings : Seq [Def .Setting [_]] = Seq (
210
211
name := " article-api" ,
211
212
libraryDependencies := dependencies
212
- ) ++ PactSettings ++ commonSettings ++ assemblySettings ++ dockerSettings() ++ tsSettings
213
+ ) ++ PactSettings ++ commonSettings ++ assemblySettings(mainClass) ++ dockerSettings() ++ tsSettings
213
214
214
215
val configs : Seq [sbt.librarymanagement.Configuration ] = Seq (
215
216
PactTestConfig
@@ -225,6 +226,7 @@ object Dependencies {
225
226
}
226
227
227
228
object audioapi {
229
+ lazy val mainClass = " no.ndla.audioapi.JettyLauncher"
228
230
lazy val dependencies : Seq [ModuleID ] = Seq (
229
231
ndlaLanguage,
230
232
ndlaMapping,
@@ -233,33 +235,33 @@ object Dependencies {
233
235
elastic4sCore,
234
236
elastic4sHttp,
235
237
scalaTsi,
236
- " joda-time" % " joda-time" % " 2.10" ,
237
- " org.eclipse.jetty" % " jetty-webapp" % JettyV % " container;compile" ,
238
- " org.eclipse.jetty" % " jetty-plus" % JettyV % " container" ,
239
- " javax.servlet" % " javax.servlet-api" % " 4.0.1" % " container;provided;test" ,
240
- " org.json4s" %% " json4s-native" % Json4SV ,
241
- " org.scalikejdbc" %% " scalikejdbc" % ScalikeJDBCV ,
242
- " org.postgresql" % " postgresql" % PostgresV ,
243
- " com.zaxxer" % " HikariCP" % HikariConnectionPoolV ,
244
- " com.amazonaws" % " aws-java-sdk-s3" % AwsSdkV ,
245
- " com.amazonaws" % " aws-java-sdk-cloudwatch" % AwsSdkV ,
246
- " org.scalaj" %% " scalaj-http" % " 2.4.2" ,
247
- " vc.inreach.aws" % " aws-signing-request-interceptor" % " 0.0.22" ,
248
- " org.elasticsearch" % " elasticsearch" % ElasticsearchV ,
249
- " org.scalatest" %% " scalatest" % ScalaTestV % " test" ,
250
- " org.mockito" %% " mockito-scala" % MockitoV % " test" ,
251
- " org.mockito" %% " mockito-scala-scalatest" % MockitoV % " test" ,
252
- " org.flywaydb" % " flyway-core" % FlywayV ,
253
- " io.lemonlabs" %% " scala-uri" % " 3.2.0" ,
254
- " org.jsoup" % " jsoup" % " 1.11.3" ,
255
- " net.bull.javamelody" % " javamelody-core" % " 1.74.0" ,
256
- " org.jrobin" % " jrobin" % " 1.5.9" ,
257
- " org.typelevel" %% " cats-effect" % CatsEffectV ,
258
- ) ++ scalatra ++ logging ++ vulnerabilityOverrides
238
+ " joda-time" % " joda-time" % " 2.10" ,
239
+ " org.eclipse.jetty" % " jetty-webapp" % JettyV % " container;compile" ,
240
+ " org.eclipse.jetty" % " jetty-plus" % JettyV % " container" ,
241
+ " javax.servlet" % " javax.servlet-api" % " 4.0.1" % " container;provided;test" ,
242
+ " org.json4s" %% " json4s-native" % Json4SV ,
243
+ " org.scalikejdbc" %% " scalikejdbc" % ScalikeJDBCV ,
244
+ " org.postgresql" % " postgresql" % PostgresV ,
245
+ " com.zaxxer" % " HikariCP" % HikariConnectionPoolV ,
246
+ " com.amazonaws" % " aws-java-sdk-s3" % AwsSdkV ,
247
+ " com.amazonaws" % " aws-java-sdk-cloudwatch" % AwsSdkV ,
248
+ " org.scalaj" %% " scalaj-http" % " 2.4.2" ,
249
+ " vc.inreach.aws" % " aws-signing-request-interceptor" % " 0.0.22" ,
250
+ " org.elasticsearch" % " elasticsearch" % ElasticsearchV ,
251
+ " org.scalatest" %% " scalatest" % ScalaTestV % " test" ,
252
+ " org.mockito" %% " mockito-scala" % MockitoV % " test" ,
253
+ " org.mockito" %% " mockito-scala-scalatest" % MockitoV % " test" ,
254
+ " org.flywaydb" % " flyway-core" % FlywayV ,
255
+ " io.lemonlabs" %% " scala-uri" % " 3.2.0" ,
256
+ " org.jsoup" % " jsoup" % " 1.11.3" ,
257
+ " net.bull.javamelody" % " javamelody-core" % " 1.74.0" ,
258
+ " org.jrobin" % " jrobin" % " 1.5.9" ,
259
+ " org.typelevel" %% " cats-effect" % CatsEffectV ,
260
+ ) ++ scalatra ++ logging ++ vulnerabilityOverrides
259
261
260
262
lazy val tsSettings : Seq [Def .Setting [_]] = typescriptSettings(
261
263
name = " audio-api" ,
262
- imports = Seq (" no.ndla.audioapi.model.api._" ),
264
+ imports = Seq (" no.ndla.audioapi.model.api._" ),
263
265
exports = Seq (
264
266
" Audio" ,
265
267
" AudioSummarySearchResult" ,
@@ -281,7 +283,7 @@ object Dependencies {
281
283
lazy val settings : Seq [Def .Setting [_]] = Seq (
282
284
name := " audio-api" ,
283
285
libraryDependencies := dependencies
284
- ) ++ commonSettings ++ assemblySettings ++ dockerSettings() ++ tsSettings
286
+ ) ++ commonSettings ++ assemblySettings(mainClass) ++ dockerSettings() ++ tsSettings
285
287
286
288
lazy val plugins : Seq [sbt.Plugins ] = Seq (
287
289
DockerPlugin ,
@@ -291,6 +293,7 @@ object Dependencies {
291
293
}
292
294
293
295
object conceptapi {
296
+ val mainClass = " no.ndla.conceptapi.JettyLauncher"
294
297
lazy val dependencies : Seq [ModuleID ] = Seq (
295
298
ndlaLanguage,
296
299
ndlaNetwork,
@@ -340,17 +343,19 @@ object Dependencies {
340
343
lazy val settings : Seq [Def .Setting [_]] = Seq (
341
344
name := " concept-api" ,
342
345
libraryDependencies := dependencies
343
- ) ++ commonSettings ++ assemblySettings ++ dockerSettings() ++ tsSettings
346
+ ) ++ commonSettings ++ assemblySettings(mainClass) ++ dockerSettings() ++ tsSettings
344
347
345
348
lazy val plugins : Seq [sbt.Plugins ] = Seq (
346
349
DockerPlugin ,
347
350
JettyPlugin ,
348
- ScalaTsiPlugin
351
+ ScalaTsiPlugin ,
352
+ AssemblyPlugin
349
353
)
350
354
351
355
}
352
356
353
357
object draftapi {
358
+ lazy val mainClass = " no.ndla.draftapi.JettyLauncher"
354
359
lazy val dependencies : Seq [ModuleID ] = Seq (
355
360
ndlaLanguage,
356
361
ndlaNetwork,
@@ -409,7 +414,7 @@ object Dependencies {
409
414
lazy val settings : Seq [Def .Setting [_]] = Seq (
410
415
name := " draft-api" ,
411
416
libraryDependencies := dependencies
412
- ) ++ PactSettings ++ commonSettings ++ assemblySettings ++ dockerSettings() ++ tsSettings
417
+ ) ++ PactSettings ++ commonSettings ++ assemblySettings(mainClass) ++ dockerSettings() ++ tsSettings
413
418
414
419
lazy val configs : Seq [sbt.librarymanagement.Configuration ] = Seq (
415
420
PactTestConfig
@@ -425,6 +430,7 @@ object Dependencies {
425
430
}
426
431
427
432
object frontpageapi {
433
+ lazy val mainClass = " no.ndla.frontpageapi.Main"
428
434
lazy val dependencies : Seq [ModuleID ] = Seq (
429
435
ndlaNetwork,
430
436
ndlaMapping,
@@ -466,7 +472,7 @@ object Dependencies {
466
472
lazy val settings : Seq [Def .Setting [_]] = Seq (
467
473
name := " frontpage-api" ,
468
474
libraryDependencies := dependencies
469
- ) ++ commonSettings ++ assemblySettings ++ dockerSettings() ++ tsSettings
475
+ ) ++ commonSettings ++ assemblySettings(mainClass) ++ dockerSettings() ++ tsSettings
470
476
471
477
lazy val plugins : Seq [sbt.Plugins ] = Seq (
472
478
DockerPlugin ,
@@ -476,6 +482,7 @@ object Dependencies {
476
482
}
477
483
478
484
object imageapi {
485
+ lazy val mainClass = " no.ndla.imageapi.JettyLauncher"
479
486
lazy val dependencies : Seq [ModuleID ] = Seq (
480
487
ndlaLanguage,
481
488
ndlaMapping,
@@ -564,6 +571,7 @@ object Dependencies {
564
571
}
565
572
566
573
object learningpathapi {
574
+ lazy val mainClass = " no.ndla.imageapi.JettyLauncher"
567
575
lazy val dependencies : Seq [ModuleID ] = Seq (
568
576
ndlaLanguage,
569
577
ndlaMapping,
@@ -622,7 +630,7 @@ object Dependencies {
622
630
lazy val settings : Seq [Def .Setting [_]] = Seq (
623
631
name := " learningpath-api" ,
624
632
libraryDependencies := dependencies
625
- ) ++ PactSettings ++ commonSettings ++ assemblySettings ++ dockerSettings() ++ tsSettings
633
+ ) ++ PactSettings ++ commonSettings ++ assemblySettings(mainClass) ++ dockerSettings() ++ tsSettings
626
634
627
635
lazy val configs : Seq [sbt.librarymanagement.Configuration ] = Seq (
628
636
PactTestConfig
@@ -678,6 +686,7 @@ object Dependencies {
678
686
}
679
687
680
688
object oembedproxy {
689
+ lazy val mainClass = " no.ndla.oembedproxy.JettyLauncher"
681
690
lazy val dependencies : Seq [ModuleID ] = Seq (
682
691
ndlaNetwork,
683
692
" org.eclipse.jetty" % " jetty-webapp" % JettyV % " container;compile" ,
@@ -695,7 +704,7 @@ object Dependencies {
695
704
lazy val settings : Seq [Def .Setting [_]] = Seq (
696
705
name := " oembed-proxy" ,
697
706
libraryDependencies := dependencies
698
- ) ++ commonSettings ++ assemblySettings ++ dockerSettings()
707
+ ) ++ commonSettings ++ assemblySettings(mainClass) ++ dockerSettings()
699
708
700
709
lazy val plugins = Seq (
701
710
JettyPlugin ,
@@ -737,6 +746,7 @@ object Dependencies {
737
746
}
738
747
739
748
object searchapi {
749
+ lazy val mainClass = " no.ndla.searchapi.JettyLauncher"
740
750
lazy val dependencies : Seq [ModuleID ] = Seq (
741
751
ndlaLanguage,
742
752
ndlaMapping,
@@ -785,7 +795,7 @@ object Dependencies {
785
795
lazy val settings : Seq [Def .Setting [_]] = Seq (
786
796
name := " search-api" ,
787
797
libraryDependencies := dependencies
788
- ) ++ PactSettings ++ commonSettings ++ assemblySettings ++ dockerSettings(" -Xmx2G" ) ++ tsSettings
798
+ ) ++ PactSettings ++ commonSettings ++ assemblySettings(mainClass) ++ dockerSettings(" -Xmx2G" ) ++ tsSettings
789
799
790
800
lazy val configs : Seq [sbt.librarymanagement.Configuration ] = Seq (
791
801
PactTestConfig
0 commit comments