Skip to content

Commit a3c3f57

Browse files
committed
Oppdaterer pakking av jar og bygging av dockerfile, og tilpasser oppgradering fra java 17 til 21.
1 parent 2673d04 commit a3c3f57

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
FROM gcr.io/distroless/java17-debian11
2-
COPY build/libs/tms-event-api-all.jar app/app.jar
3-
ENV PORT=8080
4-
EXPOSE $PORT
5-
WORKDIR app
6-
CMD ["app.jar"]
1+
FROM ghcr.io/navikt/baseimages/temurin:21
2+
3+
ENV JAVA_OPTS='-XX:MaxRAMPercentage=75'
4+
5+
COPY build/libs/*.jar ./

build.gradle.kts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
22

33
plugins {
4-
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM.
54
kotlin("jvm").version(Kotlin.version)
65
kotlin("plugin.serialization").version(Kotlin.version)
76

8-
id(Shadow.pluginId) version (Shadow.version)
9-
// Apply the application plugin to add support for building a CLI application.
7+
id(TmsJarBundling.plugin)
8+
109
application
1110
}
1211

1312
kotlin {
1413
jvmToolchain {
15-
languageVersion.set(JavaLanguageVersion.of(17))
14+
languageVersion.set(JavaLanguageVersion.of(21))
1615
}
1716
}
1817

@@ -52,8 +51,6 @@ dependencies {
5251
testImplementation(Kluent.kluent)
5352
testImplementation(Mockk.mockk)
5453
testImplementation(Junit.params)
55-
testImplementation("io.ktor:ktor-server-test-host-jvm:2.3.5")
56-
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:1.9.10")
5754
testImplementation(TmsTestUtils.testUtils)
5855

5956
testRuntimeOnly(Jjwt.impl)

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/kotlin/no/nav/tms/event/api/App.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fun Application.api(
111111
}
112112

113113
private fun Application.configureShutdownHook(httpClient: HttpClient) {
114-
environment.monitor.subscribe(ApplicationStopping) {
114+
monitor.subscribe(ApplicationStopping) {
115115
httpClient.close()
116116
}
117117
}

src/main/kotlin/no/nav/tms/event/api/varsel/VarselReader.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import kotlinx.coroutines.Dispatchers
1010
import kotlinx.coroutines.withContext
1111
import no.nav.tms.event.api.config.AzureTokenFetcher
1212
import no.nav.tms.token.support.azure.validation.AzureHeader
13+
import java.net.URI
1314
import java.net.URL
1415

1516
class VarselReader(
@@ -21,7 +22,7 @@ class VarselReader(
2122
fnr: String,
2223
varselPath: String,
2324
): List<DetaljertVarsel> {
24-
val completePathToEndpoint = URL("$varselAuthorityUrl/$varselPath")
25+
val completePathToEndpoint = URI.create("$varselAuthorityUrl/$varselPath").toURL()
2526
val azureToken = azureTokenFetcher.fetchTokenForVarselAuthority()
2627
return client.getWithAzureAndFnr(completePathToEndpoint, azureToken, fnr)
2728
}

0 commit comments

Comments
 (0)