-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
159 lines (133 loc) · 5.36 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
val ktorVersion = "2.3.12"
val fuelVersion = "2.3.1"
val iaFellesVersion = "1.6.0"
val kotestVerstion = "5.9.1"
val testcontainersVersion = "1.20.2"
plugins {
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
kotlin("jvm") version "2.0.20"
// Skru json-serialisering
kotlin("plugin.serialization") version "2.0.20"
// For å bygge fatjar
id("com.github.johnrengelman.shadow") version "8.1.1"
// Apply the application plugin to add support for building a CLI application in Java.
application
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
implementation(kotlin("stdlib"))
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
// ktor
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-serialization:$ktorVersion")
implementation("io.ktor:ktor-server-auth:$ktorVersion")
implementation("io.ktor:ktor-server-auth-jwt:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
implementation("ch.qos.logback:logback-classic:1.5.8")
implementation("net.logstash.logback:logstash-logback-encoder:8.0")
implementation("io.ktor:ktor-server-call-id:$ktorVersion")
implementation("io.ktor:ktor-server-call-logging:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-client-encoding:$ktorVersion")
// metrics
implementation("io.ktor:ktor-server-metrics-micrometer:$ktorVersion")
implementation("io.micrometer:micrometer-registry-prometheus:1.13.5")
// Database
implementation("org.postgresql:postgresql:42.7.4")
implementation("com.zaxxer:HikariCP:6.0.0")
implementation("org.flywaydb:flyway-database-postgresql:10.19.0")
implementation("com.github.seratch:kotliquery:1.9.0")
// Enklere httpklient
implementation("com.github.kittinunf.fuel:fuel:$fuelVersion")
implementation("com.google.code.gson:gson:2.11.0")
// Kafka
implementation("org.apache.kafka:kafka-clients:3.8.0")
// ULID
implementation("com.github.guepardoapps:kulid:2.0.0.0")
// Funksjonelle operatorer
implementation("io.arrow-kt:arrow-core:1.2.4")
// audit log
implementation("com.papertrailapp:logback-syslog4j:1.0.0")
// Felles definisjoner for IA-domenet
implementation("com.github.navikt:ia-felles:$iaFellesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
implementation("com.nimbusds:nimbus-jose-jwt:9.41.2")
// TEST
testImplementation("org.jetbrains.kotlin:kotlin-test")
// Enklere assertions
testImplementation("io.kotest:kotest-assertions-core:$kotestVerstion")
testImplementation("io.kotest:kotest-assertions-json:$kotestVerstion")
// Testcontainers
testImplementation("org.testcontainers:testcontainers:$testcontainersVersion")
testImplementation("org.testcontainers:junit-jupiter:$testcontainersVersion")
testImplementation("org.testcontainers:postgresql:$testcontainersVersion")
testImplementation("org.testcontainers:kafka:$testcontainersVersion")
// Http-mocking
testImplementation("com.github.kittinunf.fuel:fuel-kotlinx-serialization:$fuelVersion")
testImplementation("org.wiremock:wiremock-standalone:3.9.1")
// -- validere pdfa
testImplementation("org.verapdf:validation-model:1.26.1")
// Autentisering
testImplementation("no.nav.security:mock-oauth2-server:2.1.9")
constraints {
implementation("net.minidev:json-smart") {
version {
require("2.5.1")
}
because(
"From Kotlin version: 1.7.20 -> Earlier versions of json-smart package are vulnerable to Denial of Service (DoS) due to a StackOverflowError when parsing a deeply nested JSON array or object.",
)
}
implementation("io.netty:netty-codec-http2") {
version {
require("4.1.114.Final")
}
because("Affected versions < 4.1.101.Final are vulnerable to HTTP/2 Rapid Reset Attack")
}
implementation("joda-time:joda-time") {
version {
require("2.13.0")
}
because("kotliquery har sårbar versjon på v2.11.0")
}
testImplementation("org.apache.commons:commons-compress") {
version {
require("1.27.1")
}
because("testcontainers har sårbar versjon")
}
}
}
application {
// Define the main class for the application.
mainClass.set("no.nav.lydia.AppKt")
}
val lokalDbDump: String by project
tasks {
shadowJar {
mergeServiceFiles()
manifest {
attributes(Pair("Main-Class", "no.nav.lydia.AppKt"))
}
}
withType<Test> {
dependsOn(shadowJar)
useJUnit {
if (!project.hasProperty("lokalDbDump")) {
excludeCategories("no.nav.lydia.CommandLineOnlyTest")
}
}
}
}
kotlin {
jvmToolchain(17)
}