Skip to content

Oppgraderer java versjon til 20 #658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: test and build
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '20'
check-latest: true
run: ./gradlew test shadowJar
env:
ORG_GRADLE_PROJECT_githubUser: x-access-token
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
ref: ${{ github.sha }}

- name: Set up Java
uses: actions/setup-java@v4
uses: actions/setup-java@v4.2.1
with:
java-version: '11'
java-version: '20'
distribution: 'temurin'

check-latest: true
- name: Cache gradle dependencies
uses: actions/cache@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM navikt/java:11
FROM ghcr.io/navikt/baseimages/temurin:21

COPY build/libs/*.jar ./
USER root
Expand Down
60 changes: 19 additions & 41 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val ktorVersion = "2.1.3"
val kafkaVersion = "3.3.1"
val jacksonVersion = "2.14.1"
val prometheusVersion = "0.9.0"
val prometheusVersion = "0.16.0"
val logbackVersion = "1.4.5"
val logstashVersion = "7.2"
val konfigVersion = "1.6.10.0"
val kotlinLoggerVersion = "1.8.3"
val tjenestespesifikasjonerVersion = "1.2019.12.18-12.22-ce897c4eb2c1"
val cxfVersion = "4.0.0"
val coroutinesVersion = "1.5.2"
val wireMockVersion = "2.35.0"
val mockkVersion = "1.10.5"
Expand All @@ -21,7 +19,7 @@ val restAssuredVersion = "4.3.3"
val resilience4jVersion = "1.5.0"
val threetenVersion = "1.5.0"
val kotlinReflectVersion = "1.7.21"
val cucumberVersion = "7.11.0"
val cucumberVersion = "7.17.0"
val nocommonsVersion = "0.9.0"
val graphqlKotlinClientVersion = "5.3.1"
val archUnitVersion = "0.14.1"
Expand All @@ -32,7 +30,6 @@ val activationVersion = "1.1.1"
val nvi18nVersion = "1.27"
val kotestVersion = "4.2.5"
val swaggerRequestValidatorVersion = "2.33.1"
val swaggerUiVersion = "4.15.0"
// Temporary to fix high severity Snyk vulnerabilities:
val nettyVersion = "4.1.68.Final"
val commonsCodecVersion = "3.2.2"
Expand All @@ -46,13 +43,10 @@ val mainClass = "no.nav.medlemskap.ApplicationKt"
fun tjenestespesifikasjon(name: String) = "no.nav.tjenestespesifikasjoner:$name:$tjenestespesifikasjonerVersion"

plugins {
kotlin("jvm") version "1.7.10"
id("com.github.johnrengelman.shadow") version "6.0.0"
kotlin("jvm") version "1.9.20"
id("com.github.johnrengelman.shadow") version "7.0.0"
id("com.expediagroup.graphql") version "4.0.0" apply false
id("com.github.ben-manes.versions") version "0.29.0"
id("org.jlleitschuh.gradle.ktlint") version "9.3.0"
id("org.jlleitschuh.gradle.ktlint-idea") version "9.3.0"
id("org.hidetake.swagger.generator") version "2.18.2" apply true
id("org.jetbrains.kotlin.plugin.serialization") version "1.7.10"
}

Expand All @@ -78,7 +72,7 @@ allprojects {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "20"
}

tasks.withType<Wrapper> {
Expand Down Expand Up @@ -136,10 +130,6 @@ dependencies {
implementation("org.threeten:threeten-extra:$threetenVersion")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinReflectVersion")
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinReflectVersion")
implementation("org.apache.cxf:cxf-rt-ws-security:$cxfVersion")
implementation("org.apache.cxf:cxf-rt-frontend-jaxws:$cxfVersion")
implementation("org.apache.cxf:cxf-rt-features-logging:$cxfVersion")
implementation("org.apache.cxf:cxf-rt-transports-http:$cxfVersion")
implementation("javax.activation:activation:$activationVersion")
implementation("org.apache.ws.xmlschema:xmlschema-core:$xmlSchemaVersion")
implementation("com.sun.xml.ws:jaxws-tools:$jaxwsToolsVersion") {
Expand All @@ -153,7 +143,6 @@ dependencies {
implementation("no.bekk.bekkopen:nocommons:$nocommonsVersion")
implementation("com.expediagroup:graphql-kotlin-ktor-client:$graphqlKotlinClientVersion")
implementation("com.neovisionaries:nv-i18n:$nvi18nVersion")
swaggerUI("org.webjars:swagger-ui:$swaggerUiVersion")

implementation("commons-collections:commons-collections:$commonsCodecVersion")
implementation("org.apache.httpcomponents:httpclient:$httpClientVersion")
Expand All @@ -173,6 +162,10 @@ dependencies {
testImplementation("com.willowtreeapps.assertk:assertk-jvm:$assertkVersion")
testImplementation("io.rest-assured:rest-assured:$restAssuredVersion")

testImplementation(platform("io.cucumber:cucumber-bom:7.11.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("io.cucumber:cucumber-junit-platform-engine")
testImplementation("org.junit.platform:junit-platform-suite")
testImplementation("io.cucumber:cucumber-junit:$cucumberVersion")
testImplementation("io.cucumber:cucumber-java8:$cucumberVersion")
testImplementation("com.tngtech.archunit:archunit:$archUnitVersion")
Expand All @@ -191,20 +184,13 @@ dependencies {
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

swaggerSources {
create("lovme-api").apply {
setInputFile(file("src/main/resources/lovme.yaml"))
}
sourceCompatibility = JavaVersion.VERSION_20
targetCompatibility = JavaVersion.VERSION_20
}

tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
dependsOn("ktlintFormat")
kotlinOptions.jvmTarget = "20"
}

withType<Test> {
Expand All @@ -214,12 +200,7 @@ tasks {
}
}

withType<org.hidetake.gradle.swagger.generator.GenerateSwaggerUI> {
outputDir = File(buildDir.path + "/resources/main/api")
}

withType<ShadowJar> {
dependsOn("generateSwaggerUI")
archiveBaseName.set("app")
archiveClassifier.set("")
manifest {
Expand All @@ -229,17 +210,14 @@ tasks {
)
)
}
transform(ServiceFileTransformer::class.java) {
setPath("META-INF/cxf")
include("bus-extensions.txt")
}
}
}

ktlint {
disabledRules.set(setOf("no-wildcard-imports"))
filter {
exclude("**/generated/**")
include("**/kotlin/**")
test {
useJUnitPlatform()
//Trengs inntil videre for bytebuddy med java 16, som brukes av mockk.
jvmArgs = listOf("-Dnet.bytebuddy.experimental=true")
java.targetCompatibility = JavaVersion.VERSION_20
java.sourceCompatibility = JavaVersion.VERSION_20
}

}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 13 additions & 0 deletions pdl-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import com.expediagroup.graphql.plugin.gradle.config.GraphQLSerializer
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val graphqlKotlinClientVersion = "5.3.1"
val coroutinesVersion = "1.5.2"

Expand All @@ -22,4 +24,15 @@ val graphqlGenerateClient by tasks.getting(com.expediagroup.graphql.plugin.gradl
queryFileDirectory.set("${project.projectDir}/src/main/resources/pdl")
serializer.set(GraphQLSerializer.KOTLINX)
allowDeprecatedFields.set(true)
}

java {
sourceCompatibility = JavaVersion.VERSION_20
targetCompatibility = JavaVersion.VERSION_20
}

tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "20"
}
}
13 changes: 13 additions & 0 deletions saf-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import com.expediagroup.graphql.plugin.gradle.config.GraphQLSerializer
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val graphqlKotlinClientVersion = "5.3.1"
val coroutinesVersion = "1.5.2"

Expand All @@ -22,4 +24,15 @@ val graphqlGenerateClient by tasks.getting(com.expediagroup.graphql.plugin.gradl
schemaFile.set(file("${project.projectDir}/src/main/resources/saf/saf-api-sdl.graphqls"))
queryFileDirectory.set("${project.projectDir}/src/main/resources/saf")
serializer.set(GraphQLSerializer.KOTLINX)
}

java {
sourceCompatibility = JavaVersion.VERSION_20
targetCompatibility = JavaVersion.VERSION_20
}

tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "20"
}
}
43 changes: 0 additions & 43 deletions src/main/kotlin/no/nav/medlemskap/clients/CallidInterceptor.kt

This file was deleted.

68 changes: 0 additions & 68 deletions src/main/kotlin/no/nav/medlemskap/clients/sts/StsClient.kt

This file was deleted.

28 changes: 0 additions & 28 deletions src/main/kotlin/no/nav/medlemskap/clients/udi/UdiFactory.kt

This file was deleted.

Loading
Loading