Skip to content

Commit

Permalink
Bump Kotlin til 2.0.21 og bruk Java 21 (#607)
Browse files Browse the repository at this point in the history
* Bump Kotlin til 2.0.21 og bruk Java 21

* Bruk Java 21 i Dockerfile og workflows
  • Loading branch information
bjerga authored Dec 16, 2024
1 parent d5ea63a commit 5a3aceb
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
cache: gradle
- name: Cache Gradle wrapper
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
cache: gradle
- name: Cache Gradle wrapper
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/slowtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Java environment
uses: actions/setup-java@v1
with:
java-version: '17'
java-version: 21
- name: Cache Gradle wrapper
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: Cache Gradle packages
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('build.gradle') }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
- name: Setup Java environment
uses: actions/setup-java@v1
with:
java-version: '17'
java-version: 21
- name: Cache Gradle wrapper
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: Cache Gradle packages
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('build.gradle') }}
Expand All @@ -34,4 +34,3 @@ jobs:
ORG_GRADLE_PROJECT_githubUser: x-access-token
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/navikt/baseimages/temurin:17
FROM ghcr.io/navikt/baseimages/temurin:21
COPY build/libs/*.jar ./

ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom \
Expand Down
217 changes: 98 additions & 119 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,53 +1,8 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

val version = "1.0"
val mainClass = "no.nav.syfo.AppKt"
val group = "no.nav.syfo"
val githubPassword: String by project

// Dependencies
val micrometerVersion: String by project
val flywayVersion: String by project
val cxfVersion: String by project
val kotlinVersion: String by project
val hikariVersion: String by project
val ktorVersion: String by project
val koinVersion: String by project
val tokenSupportVersion: String by project
val mockOAuth2ServerVersion: String by project
val brukernotifikasjonSchemasVersion: String by project
val jacksonVersion: String by project
val junitJupiterVersion: String by project
val assertJVersion: String by project
val prometheusVersion: String by project
val joarkHendelseVersion: String by project
val mockkVersion: String by project
val jetbrainsStdLib: String by project
val guavaVersion: String by project
val kotlinLibsVersion: String by project
val postgresVersion: String by project
val neethiVersion: String by project
val imkontraktVersion: String by project
val altinnInntektsmeldingVersion: String by project
val navSyfoCommonVersion: String by project
val navLogVersion: String by project
val fellesBackendVersion: String by project
val hagUtilsVersion: String by project
val slf4Version: String by project
val logbackVersion: String by project
val apacheHttpClientVersion: String by project
val kotlinCoroutinesVersion: String by project
val kafkaVersion: String by project
val apacheKafkaStreamsVersion: String by project
val annotationApiVersion: String by project
val altinnCorrespondanceVersion: String by project
val logbackClassicVersion: String by project
val hagDomeneInntektsmeldingVersion: String by project
val kotlinxSerializationVersion: String by project
val bakgrunnsjobbVersion: String by project
val pdlClientVersion: String by project
val tokenProviderVersion: String by project
val oppgaveClientVersion: String by project

plugins {
kotlin("jvm")
Expand All @@ -58,8 +13,10 @@ plugins {
application
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_21
}
}

tasks.test {
Expand Down Expand Up @@ -120,111 +77,133 @@ tasks.jar {
}

repositories {
val githubPassword: String by project
mavenCentral()
google()
maven(url = "https://packages.confluent.io/maven/")
maven {
credentials {
username = "x-access-token"
password = githubPassword
}
setUrl("https://maven.pkg.github.com/navikt/inntektsmelding-kontrakt")
}
maven("https://packages.confluent.io/maven/")
maven {
setUrl("https://maven.pkg.github.com/navikt/*")
credentials {
username = "x-access-token"
password = githubPassword
}
setUrl("https://maven.pkg.github.com/navikt/helse-arbeidsgiver-felles-backend")
}
maven {
credentials {
username = "x-access-token"
password = githubPassword
}
setUrl("https://maven.pkg.github.com/navikt/helsearbeidsgiver-inntektsmelding")
}
}

dependencies {
val altinnCorrespondanceVersion: String by project
val altinnInntektsmeldingVersion: String by project
val annotationApiVersion: String by project
val apacheHttpClientVersion: String by project
val apacheKafkaStreamsVersion: String by project
val assertJVersion: String by project
val bakgrunnsjobbVersion: String by project
val brukernotifikasjonSchemasVersion: String by project
val cxfVersion: String by project
val fellesBackendVersion: String by project
val flywayVersion: String by project
val guavaVersion: String by project
val hagDomeneInntektsmeldingVersion: String by project
val hagUtilsVersion: String by project
val hikariVersion: String by project
val imkontraktVersion: String by project
val jacksonVersion: String by project
val jetbrainsStdLib: String by project
val joarkHendelseVersion: String by project
val junitJupiterVersion: String by project
val kafkaVersion: String by project
val koinVersion: String by project
val kotlinCoroutinesVersion: String by project
val kotlinLibsVersion: String by project
val kotlinVersion: String by project
val kotlinxSerializationVersion: String by project
val ktorVersion: String by project
val logbackClassicVersion: String by project
val logbackVersion: String by project
val micrometerVersion: String by project
val mockOAuth2ServerVersion: String by project
val mockkVersion: String by project
val navLogVersion: String by project
val navSyfoCommonVersion: String by project
val neethiVersion: String by project
val oppgaveClientVersion: String by project
val pdlClientVersion: String by project
val postgresVersion: String by project
val prometheusVersion: String by project
val slf4Version: String by project
val tokenProviderVersion: String by project
val tokenSupportVersion: String by project

runtimeOnly("ch.qos.logback:logback-classic:$logbackClassicVersion")
runtimeOnly("io.micrometer:micrometer-registry-prometheus:$micrometerVersion")

implementation("no.nav.teamdokumenthandtering:teamdokumenthandtering-avro-schemas:$joarkHendelseVersion")
implementation("org.jetbrains.kotlin:$jetbrainsStdLib")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.google.guava:guava:$guavaVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinLibsVersion")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinLibsVersion")
implementation("org.apache.cxf:cxf-core:$cxfVersion")
implementation("org.apache.cxf:cxf-rt-databinding-jaxb:$cxfVersion")
implementation("org.postgresql:postgresql:$postgresVersion")
implementation("org.apache.neethi:neethi:$neethiVersion")
implementation("org.flywaydb:flyway-core:$flywayVersion")
implementation("org.flywaydb:flyway-database-postgresql:$flywayVersion")
implementation("no.nav.sykepenger.kontrakter:inntektsmelding-kontrakt:$imkontraktVersion")
implementation("no.nav.tjenestespesifikasjoner:nav-altinn-inntektsmelding:$altinnInntektsmeldingVersion")
implementation("no.nav.syfo.sm:syfosm-common-rest-sts:$navSyfoCommonVersion")
implementation("no.nav.syfo.sm:syfosm-common-networking:$navSyfoCommonVersion")
implementation("no.nav.common:log:$navLogVersion")
implementation("no.nav.helsearbeidsgiver:hag-bakgrunnsjobb:$bakgrunnsjobbVersion")
implementation("no.nav.helsearbeidsgiver:utils:$hagUtilsVersion")
implementation("no.nav.security:token-client-core:$tokenSupportVersion")

implementation("no.nav.security:mock-oauth2-server:$mockOAuth2ServerVersion")
implementation("no.nav.helsearbeidsgiver:pdl-client:$pdlClientVersion")
implementation("no.nav.helsearbeidsgiver:tokenprovider:$tokenProviderVersion")
implementation("no.nav.security:token-validation-ktor-v2:$tokenSupportVersion")

implementation("com.zaxxer:HikariCP:$hikariVersion")
implementation("org.slf4j:slf4j-api:$slf4Version")
implementation("net.logstash.logback:logstash-logback-encoder:$logbackVersion")
implementation("org.apache.httpcomponents:httpclient:$apacheHttpClientVersion")
implementation("io.micrometer:micrometer-core:$micrometerVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
implementation("io.confluent:kafka-avro-serializer:$kafkaVersion") { exclude("org.apache.avro:avro") }
implementation("io.confluent:kafka-streams-avro-serde:$kafkaVersion")
implementation("io.confluent:kafka-avro-serializer:$kafkaVersion") {
exclude("org.apache.avro:avro")
}
implementation("org.apache.kafka:kafka-streams:$apacheKafkaStreamsVersion")
implementation("io.ktor:ktor-server:$ktorVersion")
implementation("io.ktor:ktor-server-cors:$ktorVersion")
implementation("io.ktor:ktor-server-auth:$ktorVersion")
implementation("io.insert-koin:koin-core-jvm:$koinVersion")
implementation("io.insert-koin:koin-core:$koinVersion")
implementation("io.insert-koin:koin-ktor:$koinVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-jackson:$ktorVersion")
implementation("io.ktor:ktor-client-json:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
implementation("io.ktor:ktor-server-auth:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-server-cors:$ktorVersion")
implementation("io.ktor:ktor-server-locations:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")

implementation("io.insert-koin:koin-core-jvm:$koinVersion")
implementation("io.insert-koin:koin-core:$koinVersion")
implementation("io.insert-koin:koin-ktor:$koinVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("io.ktor:ktor-server:$ktorVersion")
implementation("io.micrometer:micrometer-core:$micrometerVersion")
implementation("io.mockk:mockk:$mockkVersion")
implementation("io.prometheus:simpleclient_common:$prometheusVersion")
implementation("io.prometheus:simpleclient_hotspot:$prometheusVersion")
implementation("no.nav.tjenestespesifikasjoner:altinn-correspondence-agency-external-basic:$altinnCorrespondanceVersion")
implementation("javax.annotation:javax.annotation-api:$annotationApiVersion")
implementation("net.logstash.logback:logstash-logback-encoder:$logbackVersion")
implementation("no.nav.common:log:$navLogVersion")
implementation("no.nav.helsearbeidsgiver:domene-inntektsmelding:$hagDomeneInntektsmeldingVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion")
implementation("io.mockk:mockk:$mockkVersion")
implementation("no.nav.helsearbeidsgiver:hag-bakgrunnsjobb:$bakgrunnsjobbVersion")
implementation("no.nav.helsearbeidsgiver:oppgave-client:$oppgaveClientVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
testImplementation(testFixtures("no.nav.helsearbeidsgiver:utils:$hagUtilsVersion"))
implementation("no.nav.helsearbeidsgiver:pdl-client:$pdlClientVersion")
implementation("no.nav.helsearbeidsgiver:tokenprovider:$tokenProviderVersion")
implementation("no.nav.helsearbeidsgiver:utils:$hagUtilsVersion")
implementation("no.nav.security:mock-oauth2-server:$mockOAuth2ServerVersion")
implementation("no.nav.security:token-client-core:$tokenSupportVersion")
implementation("no.nav.security:token-validation-ktor-v2:$tokenSupportVersion")
implementation("no.nav.syfo.sm:syfosm-common-networking:$navSyfoCommonVersion")
implementation("no.nav.syfo.sm:syfosm-common-rest-sts:$navSyfoCommonVersion")
implementation("no.nav.sykepenger.kontrakter:inntektsmelding-kontrakt:$imkontraktVersion")
implementation("no.nav.teamdokumenthandtering:teamdokumenthandtering-avro-schemas:$joarkHendelseVersion")
implementation("no.nav.tjenestespesifikasjoner:altinn-correspondence-agency-external-basic:$altinnCorrespondanceVersion")
implementation("no.nav.tjenestespesifikasjoner:nav-altinn-inntektsmelding:$altinnInntektsmeldingVersion")
implementation("org.apache.cxf:cxf-core:$cxfVersion")
implementation("org.apache.cxf:cxf-rt-databinding-jaxb:$cxfVersion")
implementation("org.apache.httpcomponents:httpclient:$apacheHttpClientVersion")
implementation("org.apache.kafka:kafka-streams:$apacheKafkaStreamsVersion")
implementation("org.apache.neethi:neethi:$neethiVersion")
implementation("org.flywaydb:flyway-core:$flywayVersion")
implementation("org.flywaydb:flyway-database-postgresql:$flywayVersion")
implementation("org.jetbrains.kotlin:$jetbrainsStdLib")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinLibsVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinLibsVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion")
implementation("org.postgresql:postgresql:$postgresVersion")
implementation("org.slf4j:slf4j-api:$slf4Version")

testImplementation(testFixtures("no.nav.helsearbeidsgiver:utils:$hagUtilsVersion"))
testImplementation("io.insert-koin:koin-test:$koinVersion")
testImplementation("io.ktor:ktor-client-mock-jvm:$ktorVersion")

testImplementation("io.ktor:ktor-client-mock:$ktorVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
testImplementation("io.ktor:ktor-server-tests:$ktorVersion")
testImplementation("io.insert-koin:koin-test:$koinVersion")

testImplementation("org.assertj:assertj-core:$assertJVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
}
Loading

0 comments on commit 5a3aceb

Please sign in to comment.