-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
148 lines (129 loc) · 4.66 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
group = "no.nav.syfo"
version = "1.0-SNAPSHOT"
val confluent = "7.7.1"
val flyway = "10.17.3"
val hikari = "5.1.0"
val isdialogmoteSchema = "1.0.5"
val jacksonDataType = "2.18.0"
val jedis = "5.2.0"
val json = "20240303"
val kafka = "3.7.0"
val kluent = "1.73"
val ktor = "2.3.12"
val logback = "1.5.11"
val logstashEncoder = "7.4"
val mockk = "1.13.13"
val micrometerRegistry = "1.12.8"
val nimbusjosejwt = "9.41.2"
val postgresEmbedded = "2.0.7"
val postgres = "42.7.4"
val spek = "2.0.19"
plugins {
kotlin("jvm") version "2.0.21"
id("com.gradleup.shadow") version "8.3.3"
id("org.jlleitschuh.gradle.ktlint") version "11.6.0"
id("com.github.davidmc24.gradle.plugin.avro") version "1.8.0"
}
repositories {
mavenCentral()
maven(url = "https://packages.confluent.io/maven/")
maven(url = "https://jitpack.io")
maven {
url = uri("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
}
}
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
implementation("io.ktor:ktor-server-auth-jwt:$ktor")
implementation("io.ktor:ktor-client-apache:$ktor")
implementation("io.ktor:ktor-client-cio:$ktor")
implementation("io.ktor:ktor-client-content-negotiation:$ktor")
implementation("io.ktor:ktor-serialization-jackson:$ktor")
implementation("io.ktor:ktor-server-call-id:$ktor")
implementation("io.ktor:ktor-server-content-negotiation:$ktor")
implementation("io.ktor:ktor-server-netty:$ktor")
implementation("io.ktor:ktor-server-status-pages:$ktor")
// Logging
implementation("ch.qos.logback:logback-classic:$logback")
implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoder")
implementation("org.json:json:$json")
// Metrics and Prometheus
implementation("io.ktor:ktor-server-metrics-micrometer:$ktor")
implementation("io.micrometer:micrometer-registry-prometheus:$micrometerRegistry")
// Cache
implementation("redis.clients:jedis:$jedis")
// (De-)serialization
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonDataType")
// Database
implementation("org.postgresql:postgresql:$postgres")
implementation("com.zaxxer:HikariCP:$hikari")
implementation("org.flywaydb:flyway-database-postgresql:$flyway")
testImplementation("io.zonky.test:embedded-postgres:$postgresEmbedded")
// Kafka
val excludeLog4j = fun ExternalModuleDependency.() {
exclude(group = "log4j")
}
implementation("org.apache.kafka:kafka_2.13:$kafka", excludeLog4j)
implementation("io.confluent:kafka-avro-serializer:$confluent", excludeLog4j)
constraints {
implementation("org.apache.zookeeper:zookeeper") {
because("io.confluent:kafka-schema-registry:$confluent -> https://www.cve.org/CVERecord?id=CVE-2023-44981")
version {
require("3.9.3")
}
}
implementation("org.apache.avro:avro") {
because("io.confluent:kafka-schema-registry:$confluent -> https://www.cve.org/CVERecord?id=CVE-2023-39410")
version {
require("1.12.0")
}
}
implementation("org.apache.commons:commons-compress") {
because("org.apache.commons:commons-compress:1.22 -> https://www.cve.org/CVERecord?id=CVE-2012-2098")
version {
require("1.27.1")
}
}
}
implementation("no.nav.syfo.dialogmote.avro:isdialogmote-schema:$isdialogmoteSchema")
testImplementation("com.nimbusds:nimbus-jose-jwt:$nimbusjosejwt")
testImplementation("io.ktor:ktor-server-test-host:$ktor")
testImplementation("io.ktor:ktor-client-mock:$ktor")
testImplementation("io.mockk:mockk:$mockk")
testImplementation("org.amshove.kluent:kluent:$kluent")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spek") {
exclude(group = "org.jetbrains.kotlin")
}
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spek") {
exclude(group = "org.jetbrains.kotlin")
}
}
kotlin {
jvmToolchain(21)
}
tasks {
jar {
manifest.attributes["Main-Class"] = "no.nav.syfo.AppKt"
}
create("printVersion") {
println(project.version)
}
shadowJar {
mergeServiceFiles()
archiveBaseName.set("app")
archiveClassifier.set("")
archiveVersion.set("")
}
withType<KotlinCompile> {
dependsOn(":generateAvroJava")
dependsOn(":generateTestAvroJava")
}
test {
useJUnitPlatform {
includeEngines("spek2")
}
testLogging.showStandardStreams = true
}
}