-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
146 lines (123 loc) · 4.7 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
group = "no.nav.syfo"
version = "1.0.0"
val javaVersion = JvmTarget.JVM_21
val coroutinesVersion = "1.10.1"
val kluentVersion = "1.73"
val ktorVersion = "3.1.1"
val logbackVersion = "1.5.17"
val prometheusVersion = "0.16.0"
val kotestVersion = "5.9.1"
val logstashEncoderVersion = "8.0"
val kafkaVersion = "3.9.0"
val jacksonVersion = "2.18.3"
val avroVersion = "1.12.0"
val confluentVersion = "7.9.0"
val postgresVersion = "42.7.5"
val flywayVersion = "11.4.0"
val hikariVersion = "6.2.1"
val brukernotifikasjonAvroVersion = "1.2022.04.13-12.09-292ce6d359bd"
val mockkVersion = "1.13.17"
val kotlinVersion = "2.1.10"
val testContainerVersion = "1.20.6"
val ktfmtVersion = "0.44"
val opentelemetryVersion = "2.14.0"
//Added due to vulnerabilities
val snappyJavaVersion = "1.1.10.7"
val nettycommonVersion = "4.1.119.Final"
plugins {
id("application")
kotlin("jvm") version "2.1.10"
id("com.diffplug.spotless") version "7.0.2"
id("com.gradleup.shadow") version "8.3.6"
}
application {
mainClass.set("no.nav.syfo.syfosmvarsel.BootstrapKt")
}
kotlin {
compilerOptions {
jvmTarget.set(javaVersion)
}
}
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("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
constraints {
implementation("io.netty:netty-common:$nettycommonVersion") {
because("Due to vulnerabilities in io.ktor:ktor-server-netty")
}
}
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
implementation("io.prometheus:simpleclient_hotspot:$prometheusVersion")
implementation("io.prometheus:simpleclient_common:$prometheusVersion")
implementation("org.apache.kafka:kafka_2.12:$kafkaVersion")
constraints {
implementation("org.xerial.snappy:snappy-java:$snappyJavaVersion") {
because("override transient from org.apache.kafka:kafka_2.12")
}
}
implementation("io.confluent:kafka-avro-serializer:$confluentVersion")
implementation("org.apache.avro:avro:$avroVersion")
implementation("com.github.navikt:brukernotifikasjon-schemas:$brukernotifikasjonAvroVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("org.postgresql:postgresql:$postgresVersion")
implementation("com.zaxxer:HikariCP:$hikariVersion")
compileOnly("org.flywaydb:flyway-core:$flywayVersion")
implementation("org.flywaydb:flyway-database-postgresql:$flywayVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("net.logstash.logback:logstash-logback-encoder:$logstashEncoderVersion")
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:$opentelemetryVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
testImplementation("org.amshove.kluent:kluent:$kluentVersion")
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion") {
exclude(group = "org.eclipse.jetty")
exclude(group = "commons-codec")
}
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("org.testcontainers:postgresql:$testContainerVersion")
testImplementation("org.testcontainers:kafka:$testContainerVersion")
}
tasks {
shadowJar {
mergeServiceFiles {
setPath("META-INF/services/org.flywaydb.core.extensibility.Plugin")
}
archiveBaseName.set("app")
archiveClassifier.set("")
isZip64 = true
manifest {
attributes(
mapOf(
"Main-Class" to "no.nav.syfo.syfosmvarsel.BootstrapKt",
),
)
}
}
test {
useJUnitPlatform {}
testLogging {
events("passed", "skipped", "failed")
showStackTraces = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
spotless {
kotlin { ktfmt(ktfmtVersion).kotlinlangStyle() }
check {
dependsOn("spotlessApply")
}
}
}