From a26182b04da8c0eeddd15b7cbeba7ddf5052a789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Eikanger=20Kval=C3=B8?= Date: Wed, 22 Mar 2023 14:41:51 +0100 Subject: [PATCH] FIKS-150 Oppgrader til Spring Boot 3 (#396) * Bruk ny pipeline * Oppdater pipeline igjen * FIKS-150 Endringer for Spring Boot 3 --- Jenkinsfile | 2 +- README.md | 12 ++++++++ maskinporten-client/pom.xml | 2 +- maskinporten-spring-boot-client/pom.xml | 29 ++++++++++++------- .../maskinporten/MaskinportenProperties.kt | 4 +-- .../main/resources/META-INF/spring.factories | 2 -- ...ot.autoconfigure.AutoConfiguration.imports | 1 + pom.xml | 19 ++++-------- 8 files changed, 39 insertions(+), 32 deletions(-) delete mode 100644 maskinporten-spring-boot-client/src/main/resources/META-INF/spring.factories create mode 100644 maskinporten-spring-boot-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/Jenkinsfile b/Jenkinsfile index abc2dff..5728d70 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,3 @@ -libPipelineMvnCentral( +libPipelineMvnCentralJdk17( dtProjectId: "5b5106ae-8298-421a-b578-9178de4a3887" ) diff --git a/README.md b/README.md index 7816d4b..1fbeb67 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,18 @@ Mottatte access-token blir lagret i en cache og vil bli gjenbrukt frem til de ut Dette er nyttig dersom det gjøres en forespørsel rett før tokenet utløper og det er fare for at tokenet blir ugyldig før forespørselen sendes. Konfigurasjon gjøres ved initiering av klienten og styres i feltet "numberOfSecondsLeftBeforeExpire". +## Versjoner + +| Versjon | Java baseline | Spring Boot versjon | Status | +|---------|---------------|---------------------|-------------| +| 3.x | Java 17 | 3.X | Aktiv | +| 2.X | Java 11 | 2.X | Vedlikehold | + +### Status +- **Aktiv**: versjon som aktivt utvikles og holdes oppdatert mht. avhengigheter +- **Vedlikehold**: kun kritiske feil vil bli adressert + + ## Maven koordinater ```xml diff --git a/maskinporten-client/pom.xml b/maskinporten-client/pom.xml index 4d13380..f960340 100644 --- a/maskinporten-client/pom.xml +++ b/maskinporten-client/pom.xml @@ -7,7 +7,7 @@ no.ks.fiks maskinporten - 2.2.1-SNAPSHOT + 3.0.0-SNAPSHOT maskinporten-client ${project.artifactId} diff --git a/maskinporten-spring-boot-client/pom.xml b/maskinporten-spring-boot-client/pom.xml index c3e2757..fa2cf73 100644 --- a/maskinporten-spring-boot-client/pom.xml +++ b/maskinporten-spring-boot-client/pom.xml @@ -3,18 +3,17 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - 2.7.9 - 1.1.2 - - no.ks.fiks maskinporten - 2.2.1-SNAPSHOT + 3.0.0-SNAPSHOT maskinporten-spring-boot-client ${project.artifactId} + + 3.0.4 + 1.1.2 + @@ -47,14 +46,19 @@ virksomhetssertifikat - org.hibernate - hibernate-validator + org.springframework.boot + spring-boot-autoconfigure org.springframework.boot - spring-boot-autoconfigure + spring-boot-autoconfigure-processor + true + + + org.hibernate.validator + hibernate-validator + test - io.kotest kotest-runner-junit5-jvm @@ -85,7 +89,6 @@ org.springframework.boot spring-boot-test-autoconfigure - ${spring-boot.version} test @@ -110,6 +113,10 @@ maven-surefire-plugin + + org.jetbrains.dokka + dokka-maven-plugin + diff --git a/maskinporten-spring-boot-client/src/main/kotlin/no/ks/fiks/maskinporten/MaskinportenProperties.kt b/maskinporten-spring-boot-client/src/main/kotlin/no/ks/fiks/maskinporten/MaskinportenProperties.kt index a0792fd..92a7635 100644 --- a/maskinporten-spring-boot-client/src/main/kotlin/no/ks/fiks/maskinporten/MaskinportenProperties.kt +++ b/maskinporten-spring-boot-client/src/main/kotlin/no/ks/fiks/maskinporten/MaskinportenProperties.kt @@ -1,13 +1,11 @@ package no.ks.fiks.maskinporten +import jakarta.validation.constraints.NotNull import org.springframework.boot.context.properties.ConfigurationProperties -import org.springframework.boot.context.properties.ConstructorBinding import org.springframework.validation.annotation.Validated -import javax.validation.constraints.NotNull internal const val DEFAULT_SECONDS_LEFT_BEFORE_EXPIRATION = 10 -@ConstructorBinding @ConfigurationProperties(prefix = "maskinporten") @Validated data class MaskinportenProperties( diff --git a/maskinporten-spring-boot-client/src/main/resources/META-INF/spring.factories b/maskinporten-spring-boot-client/src/main/resources/META-INF/spring.factories deleted file mode 100644 index ee5e9b1..0000000 --- a/maskinporten-spring-boot-client/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - no.ks.fiks.maskinporten.MaskinportenAutoConfigure \ No newline at end of file diff --git a/maskinporten-spring-boot-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/maskinporten-spring-boot-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..6b45a9a --- /dev/null +++ b/maskinporten-spring-boot-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +no.ks.fiks.maskinporten.MaskinportenAutoConfigure \ No newline at end of file diff --git a/pom.xml b/pom.xml index bee7ba1..6f67ff8 100644 --- a/pom.xml +++ b/pom.xml @@ -7,12 +7,12 @@ no.ks.fiks.pom fiks-ekstern-kotlin-superpom - 1.0.20 + 1.0.21 no.ks.fiks maskinporten - 2.2.1-SNAPSHOT + 3.0.0-SNAPSHOT pom ${project.artifactId} ${project.artifactId} @@ -30,20 +30,18 @@ - 11 - 11 + 17 + 17 UTF-8 2.8.2 - 3.0.0-M9 9.31 - 3.0.2 + 4.0.0 0.5.10 5.15.0 1.7 10.7 - 6.2.3.Final 5.2.1 5.9.2 @@ -78,12 +76,6 @@ maskinporten-client ${project.version} - - org.hibernate - hibernate-validator - ${hibernate-validator.version} - - org.apache.httpcomponents.client5 httpclient5 @@ -179,7 +171,6 @@ maven-surefire-plugin - ${maven-surefire-plugin.version} maven-source-plugin