Skip to content

Commit

Permalink
Merge pull request #359 from navikt/spring-boot-3
Browse files Browse the repository at this point in the history
Spring boot 3
  • Loading branch information
olekvernberg authored Jul 20, 2023
2 parents 5a3e7b8 + 815b75e commit 3d6a3d9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
25 changes: 16 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,24 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.10</version>
<version>3.1.1</version>
</parent>

<properties>
<revision>1.0</revision>
<changelist>-SNAPSHOT</changelist>
<jvmTarget>17</jvmTarget>
<main-class>no.nav.familie.dokument.LauncherKt</main-class>
<felles.version>1.20230117091843_19b020f</felles.version>
<kotlin.version>1.8.20</kotlin.version>
<felles.version>2.20230508082643_6b28bd8</felles.version>
<kotlin.version>1.9.0</kotlin.version>
<mockk.version>1.13.5</mockk.version>
<token-validation-spring.version>2.1.9</token-validation-spring.version>
<token-validation-spring.version>3.0.4</token-validation-spring.version>
<openhtmltopdf.version>1.0.10</openhtmltopdf.version>
<gcp.version>0.195.0</gcp.version>
<kontrakter.version>2.0_20230112155838_ab5a243</kontrakter.version>
<kontrakter.version>3.0_20230705132547_9303863</kontrakter.version>
<tika.core.version>2.6.0</tika.core.version>
<tika.parser.version>2.6.0</tika.parser.version>
<jsoup.version>1.16.1</jsoup.version>
<!-- Setter disse til token-support sine versjoner, versjoner(9.x) i spring er ikke kompatibel med oauth2-oidc-sdk -->
<nimbus-jose-jwt.version>8.20.2</nimbus-jose-jwt.version>
<testcontainers.version>1.17.6</testcontainers.version>
</properties>

Expand Down Expand Up @@ -69,6 +67,11 @@
</exclusion>
</exclusions>
</dependency>
<!-- https://github.com/spring-projects/spring-boot/issues/33044#issuecomment-1379812611 -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -227,10 +230,15 @@
<!-- PDFgen -->

<!-- PDF/A-2U-validering -->
<dependency>
<groupId>org.verapdf</groupId>
<artifactId>core-jakarta</artifactId>
<version>1.24.1</version>
</dependency>
<dependency>
<groupId>org.verapdf</groupId>
<artifactId>validation-model</artifactId>
<version>1.22.2</version>
<version>1.24.1</version>
</dependency>
<!-- PDF/A-2U-validering -->
</dependencies>
Expand Down Expand Up @@ -285,7 +293,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<mainClass>${main-class}</mainClass>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class ApiExceptionHandler : ResponseEntityExceptionHandler() {
return NestedExceptionUtils.getMostSpecificCause(throwable).javaClass.simpleName
}

override fun handleExceptionInternal(
fun handleExceptionInternal(
ex: Exception,
body: Any?,
headers: HttpHeaders,
status: HttpStatus,
request: WebRequest,
): ResponseEntity<Any> {
): ResponseEntity<Any>? {
if (ex is HttpRequestMethodNotSupportedException || ex is HttpMediaTypeNotSupportedException || ex is HttpMediaTypeNotAcceptableException) {
secureLogger.warn("En feil har oppstått", ex)
logger.warn("En feil har oppstått - throwable=${rootCause(ex)} status=${status.value()}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package no.nav.familie.dokument.config

import jakarta.servlet.Filter
import jakarta.servlet.FilterChain
import jakarta.servlet.ServletException
import jakarta.servlet.ServletRequest
import jakarta.servlet.ServletResponse
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.core.annotation.Order
import org.springframework.stereotype.Component
import java.io.IOException
import javax.servlet.Filter
import javax.servlet.FilterChain
import javax.servlet.ServletException
import javax.servlet.ServletRequest
import javax.servlet.ServletResponse
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

@Component
@Order(0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package no.nav.familie.dokument.config

import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.ConstructorBinding

@ConfigurationProperties(prefix = "cors")
@ConstructorBinding
data class CorsProperties(val allowedOrigins: Set<String>)
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ management:
base-path: "/internal"
path-mapping:
info: "status/isAlive"
metrics.export.prometheus.enabled: true
prometheus.metrics.export.enabled: true

attachment.max.size.mb: 20
storage_service.timeout.ms: 3000
Expand Down

0 comments on commit 3d6a3d9

Please sign in to comment.