-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
209 lines (193 loc) · 7.52 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
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
group = "no.nav.syfo"
version = "1.0-SNAPSHOT"
val confluentVersion = "7.7.1"
val jacksonDataTypeVersion = "2.17.1"
val flywayVersion = "10.17.2"
val hikariVersion = "5.1.0"
val isdialogmoteSchemaVersion = "1.0.5"
val jsonVersion = "20240303"
val jettyVersion = "9.4.56.v20240826"
val kafkaVersion = "3.7.0"
val kluentVersion = "1.73"
val ktorVersion = "2.3.12"
val logbackVersion = "1.5.7"
val logstashEncoderVersion = "7.4"
val micrometerRegistryVersion = "1.12.6"
val mockkVersion = "1.13.9"
val nettyVersion = "4.1.115.Final"
val nimbusjosejwtVersion = "9.40"
val joseVersion = "0.9.4"
val postgresVersion = "42.7.4"
val postgresEmbeddedVersion = "2.0.7"
val spekVersion = "2.0.19"
plugins {
kotlin("jvm") version "2.0.20"
id("com.gradleup.shadow") version "8.3.1"
id("org.jlleitschuh.gradle.ktlint") version "11.4.2"
}
val githubUser: String by project
val githubPassword: String by project
repositories {
mavenCentral()
maven(url = "https://packages.confluent.io/maven/")
maven(url = "https://repository.mulesoft.org/nexus/content/repositories/public/")
maven(url = "https://jitpack.io")
maven {
url = uri("https://maven.pkg.github.com/navikt/isdialogmote-schema")
credentials {
username = githubUser
password = githubPassword
}
}
}
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
implementation("io.ktor:ktor-server-auth-jwt:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-server-call-id:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
constraints {
implementation("io.netty:netty-codec-http2") {
because("io.ktor:ktor-server-netty:$ktorVersion -> https://ossindex.sonatype.org/vulnerability/CVE-2024-47535")
version {
require(nettyVersion)
}
}
}
implementation("io.ktor:ktor-client-apache:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
// Logging
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoderVersion")
implementation("org.json:json:$jsonVersion")
// Metrics and Prometheus
implementation("io.ktor:ktor-server-metrics-micrometer:$ktorVersion")
implementation("io.micrometer:micrometer-registry-prometheus:$micrometerRegistryVersion")
// (De-)serialization
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonDataTypeVersion")
// Database
implementation("org.postgresql:postgresql:$postgresVersion")
implementation("org.flywaydb:flyway-database-postgresql:$flywayVersion")
implementation("com.zaxxer:HikariCP:$hikariVersion")
testImplementation("io.zonky.test:embedded-postgres:$postgresEmbeddedVersion")
val excludeLog4j = fun ExternalModuleDependency.() {
exclude(group = "log4j")
}
// Kafka
implementation("org.apache.kafka:kafka_2.13:$kafkaVersion", excludeLog4j)
constraints {
implementation("org.bitbucket.b_c:jose4j") {
because("org.bitbucket.b_c:jose4j:0.9.3 -> https://ossindex.sonatype.org/vulnerability/CVE-2023-51775")
version {
require(joseVersion)
}
}
}
implementation("io.confluent:kafka-avro-serializer:$confluentVersion")
constraints {
implementation("org.apache.avro:avro") {
because("io.confluent:kafka-avro-serializer:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-39410")
version {
require("1.11.4")
}
}
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.26.0")
}
}
implementation("com.google.guava:guava") {
because("com.google.guava:guava:30.1.1-jre -> https://www.cve.org/CVERecord?id=CVE-2020-8908")
version {
require("32.1.3-jre")
}
}
}
implementation("io.confluent:kafka-schema-registry:$confluentVersion", excludeLog4j)
constraints {
implementation("org.apache.zookeeper:zookeeper") {
because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-44981")
version {
require("3.9.3")
}
}
implementation("com.google.protobuf:protobuf-java") {
because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2021-22569")
version {
require("3.25.5")
}
}
implementation("org.eclipse.jetty:jetty-server") {
because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-36478")
version {
require(jettyVersion)
}
}
implementation("org.eclipse.jetty:jetty-xml") {
because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-36478")
version {
require(jettyVersion)
}
}
implementation("org.eclipse.jetty:jetty-servlets") {
because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-36478")
version {
require(jettyVersion)
}
}
implementation("org.eclipse.jetty.http2:http2-server") {
because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2023-36478")
version {
require(jettyVersion)
}
}
implementation("io.github.classgraph:classgraph") {
because("io.confluent:kafka-schema-registry:$confluentVersion -> https://www.cve.org/CVERecord?id=CVE-2021-47621")
version {
require("4.8.179")
}
}
}
implementation("no.nav.syfo.dialogmote.avro:isdialogmote-schema:$isdialogmoteSchemaVersion")
testImplementation("com.nimbusds:nimbus-jose-jwt:$nimbusjosejwtVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
testImplementation("io.ktor:ktor-client-mock:$ktorVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("org.amshove.kluent:kluent:$kluentVersion")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion") {
exclude(group = "org.jetbrains.kotlin")
}
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion") {
exclude(group = "org.jetbrains.kotlin")
}
}
kotlin {
jvmToolchain(21)
}
tasks {
jar {
manifest.attributes["Main-Class"] = "no.nav.syfo.MainApplicationKt"
}
create("printVersion") {
doLast {
println(project.version)
}
}
shadowJar {
mergeServiceFiles()
archiveBaseName.set("app")
archiveClassifier.set("")
archiveVersion.set("")
}
test {
useJUnitPlatform {
includeEngines("spek2")
}
testLogging.showStandardStreams = true
}
}