From 2efe58d120fc4f837544745bac201485c305d405 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Tue, 26 Aug 2025 14:46:10 +0200 Subject: [PATCH 1/2] Bump Spring Boot 4 to M2 --- gradle/libs.versions.toml | 2 +- sentry-spring-7/build.gradle.kts | 3 +++ .../io/sentry/spring7/mvc/SentrySpringIntegrationTest.kt | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 62e486bd084..16cc70ce6b4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,7 +31,7 @@ retrofit = "2.9.0" slf4j = "1.7.30" springboot2 = "2.7.18" springboot3 = "3.5.0" -springboot4 = "4.0.0-M1" +springboot4 = "4.0.0-M2" # Android targetSdk = "34" compileSdk = "34" diff --git a/sentry-spring-7/build.gradle.kts b/sentry-spring-7/build.gradle.kts index 45a70b33a6b..7cc18f99e37 100644 --- a/sentry-spring-7/build.gradle.kts +++ b/sentry-spring-7/build.gradle.kts @@ -29,6 +29,9 @@ tasks.withType().configureEach { dependencies { api(projects.sentry) compileOnly(platform(SpringBootPlugin.BOM_COORDINATES)) + + // Force all Netty modules to use the same version to avoid version conflicts + testImplementation(platform("io.netty:netty-bom:4.2.4.Final")) compileOnly(Config.Libs.springWeb) compileOnly(Config.Libs.springAop) compileOnly(Config.Libs.springSecurityWeb) diff --git a/sentry-spring-7/src/test/kotlin/io/sentry/spring7/mvc/SentrySpringIntegrationTest.kt b/sentry-spring-7/src/test/kotlin/io/sentry/spring7/mvc/SentrySpringIntegrationTest.kt index c9a05dbdad6..1127456cc6c 100644 --- a/sentry-spring-7/src/test/kotlin/io/sentry/spring7/mvc/SentrySpringIntegrationTest.kt +++ b/sentry-spring-7/src/test/kotlin/io/sentry/spring7/mvc/SentrySpringIntegrationTest.kt @@ -389,21 +389,21 @@ open class App { @Bean open fun sentryUserFilter(scopes: IScopes, @Lazy sentryUserProviders: List) = FilterRegistrationBean().apply { - this.filter = SentryUserFilter(scopes, sentryUserProviders) + this.setFilter(SentryUserFilter(scopes, sentryUserProviders)) this.order = Ordered.LOWEST_PRECEDENCE } @Bean open fun sentrySpringFilter(scopes: IScopes) = FilterRegistrationBean().apply { - this.filter = SentrySpringFilter(scopes) + this.setFilter(SentrySpringFilter(scopes)) this.order = Ordered.HIGHEST_PRECEDENCE } @Bean open fun sentryTracingFilter(scopes: IScopes) = FilterRegistrationBean().apply { - this.filter = SentryTracingFilter(scopes) + this.setFilter(SentryTracingFilter(scopes)) this.order = Ordered.HIGHEST_PRECEDENCE + 1 // must run after SentrySpringFilter } From 549e9a7fe84224a1553eed1a5d6963eb2aa134ba Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Wed, 27 Aug 2025 13:27:36 +0200 Subject: [PATCH 2/2] replace netty bom with boot plugin bom --- sentry-spring-7/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry-spring-7/build.gradle.kts b/sentry-spring-7/build.gradle.kts index 7cc18f99e37..cb85ae85c36 100644 --- a/sentry-spring-7/build.gradle.kts +++ b/sentry-spring-7/build.gradle.kts @@ -28,10 +28,9 @@ tasks.withType().configureEach { dependencies { api(projects.sentry) + compileOnly(platform(SpringBootPlugin.BOM_COORDINATES)) - // Force all Netty modules to use the same version to avoid version conflicts - testImplementation(platform("io.netty:netty-bom:4.2.4.Final")) compileOnly(Config.Libs.springWeb) compileOnly(Config.Libs.springAop) compileOnly(Config.Libs.springSecurityWeb) @@ -57,6 +56,7 @@ dependencies { errorprone(libs.nopen.checker) errorprone(libs.nullaway) + testImplementation(platform(SpringBootPlugin.BOM_COORDINATES)) // tests testImplementation(projects.sentryTestSupport) testImplementation(projects.sentryGraphql)