diff --git a/build.gradle.kts b/build.gradle.kts index 30037401cf..73668ab68f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,6 @@ plugins { } version = "0.0.1" -val ktorVersion: String by project subprojects { apply(plugin = "org.jetbrains.kotlin.jvm") @@ -75,17 +74,17 @@ subprojects { implementation("com.github.navikt:vault-jdbc:1.3.10") implementation("org.postgresql:postgresql:42.7.0") - implementation("io.ktor:ktor-server-netty:$ktorVersion") - implementation("io.ktor:ktor-server-auth-jwt:$ktorVersion") { + implementation(rootProject.libs.ktor.server.netty) + implementation(rootProject.libs.ktor.server.auth.jwt) { exclude(group = "junit") } - implementation("io.ktor:ktor-server-metrics-micrometer:$ktorVersion") - implementation("io.ktor:ktor-serialization-jackson:$ktorVersion") - implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion") - implementation("io.ktor:ktor-server-call-id:$ktorVersion") - implementation("io.ktor:ktor-server-call-logging:$ktorVersion") - implementation("io.ktor:ktor-server-forwarded-header:$ktorVersion") - implementation("io.ktor:ktor-server-status-pages:$ktorVersion") + implementation(rootProject.libs.ktor.server.metrics.micrometer) + implementation(rootProject.libs.ktor.serialization.jackson) + implementation(rootProject.libs.ktor.server.content.negotiation) + implementation(rootProject.libs.ktor.server.call.id) + implementation(rootProject.libs.ktor.server.call.logging) + implementation(rootProject.libs.ktor.server.forwarded.header) + implementation(rootProject.libs.ktor.server.status.pages) testRuntimeOnly(rootProject.libs.jupiter.engine) @@ -108,7 +107,7 @@ subprojects { // Legger til manglende binaries for nye Mac's med M1 cpuer. testImplementation("io.zonky.test.postgres:embedded-postgres-binaries-darwin-arm64v8") testImplementation("org.xmlunit:xmlunit-matchers:2.9.1") - testImplementation("io.ktor:ktor-server-test-host:$ktorVersion") { + testImplementation(rootProject.libs.ktor.server.test.host) { exclude(group = "junit") exclude(group = "org.eclipse.jetty") // conflicts with WireMock exclude(group = "org.eclipse.jetty.http2") // conflicts with WireMock diff --git a/gradle.properties b/gradle.properties index c94fa5e6ef..b108979180 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,4 +2,3 @@ org.gradle.jvmargs=-Xmx4000m org.gradle.parallel=true org.gradle.caching=true org.gradle.daemon=true -ktorVersion=2.3.5 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4af909159f..64fce221ba 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,6 +7,7 @@ kittinunf = "2.3.1" wiremock = "3.3.1" jupiter = "5.10.1" kotlin = "1.9.21" +ktor = "2.3.6" [libraries] slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" } @@ -23,5 +24,17 @@ kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", vers kotlin-script-runtime = { group = "org.jetbrains.kotlin", name = "kotlin-script-runtime", version.ref = "kotlin" } kotlin-compiler-embeddable = { group = "org.jetbrains.kotlin", name = "kotlin-compiler-embeddable", version.ref = "kotlin" } +ktor-server-test-host = { group = "io.ktor", name = "ktor-server-test-host", version.ref = "ktor" } +ktor-server-netty = { group = "io.ktor", name = "ktor-server-netty", version.ref = "ktor" } +ktor-server-auth-jwt = { group = "io.ktor", name = "ktor-server-auth-jwt", version.ref = "ktor" } +ktor-server-metrics-micrometer = { group = "io.ktor", name = "ktor-server-metrics-micrometer", version.ref = "ktor" } +ktor-server-content-negotiation = { group = "io.ktor", name = "ktor-server-content-negotiation", version.ref = "ktor" } +ktor-server-call-id = { group = "io.ktor", name = "ktor-server-call-id", version.ref = "ktor" } +ktor-server-call-logging = { group = "io.ktor", name = "ktor-server-call-logging", version.ref = "ktor" } +ktor-server-forwarded-header = { group = "io.ktor", name = "ktor-server-forwarded-header", version.ref = "ktor" } +ktor-server-status-pages = { group = "io.ktor", name = "ktor-server-status-pages", version.ref = "ktor" } +ktor-serialization-jackson = { group = "io.ktor", name = "ktor-serialization-jackson", version.ref = "ktor" } +ktor-client-java = { group = "io.ktor", name = "ktor-client-java", version.ref = "ktor" } + [plugins] kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } diff --git a/test-common/build.gradle.kts b/test-common/build.gradle.kts index a9acd2c55d..ea0eb82558 100644 --- a/test-common/build.gradle.kts +++ b/test-common/build.gradle.kts @@ -1,5 +1,4 @@ // Contains shared test-data, functions and extension funcions to be used across modules -val ktorVersion: String by project dependencies { val kotestVersion = "5.8.0" diff --git a/web-regresjonstest/build.gradle.kts b/web-regresjonstest/build.gradle.kts index 4c6b4f0b00..fa272b1307 100644 --- a/web-regresjonstest/build.gradle.kts +++ b/web-regresjonstest/build.gradle.kts @@ -1,6 +1,5 @@ // Inneholder regresjonstester for web-laget (black-box asserting). // Separert til sin egen modul for å kunne bygges parallelt med de andre testene på byggserveren. -val ktorVersion: String by project dependencies { implementation(project(":domain")) implementation(project(":database")) @@ -31,8 +30,8 @@ dependencies { implementation(project(":person:domain")) - implementation("io.ktor:ktor-client-java:$ktorVersion") - implementation("io.ktor:ktor-server-test-host:$ktorVersion") { + implementation(rootProject.libs.ktor.client.java) + implementation(rootProject.libs.ktor.server.test.host) { exclude(group = "junit") exclude(group = "org.eclipse.jetty") // conflicts with WireMock exclude(group = "org.eclipse.jetty.http2") // conflicts with WireMock