Skip to content

Commit a979f23

Browse files
adinauerclaude
andauthored
fix(spring): Support Spring Boot 4.1 (#5573)
* fix(spring): Support Spring Boot 4.1 Bump OpenTelemetry and Spring Boot dependencies to compatible versions so the Spring Boot 4 OpenTelemetry sample works with Spring Boot 4.1. Keep the Spring 7 sample on the repository Kotlin compiler version when importing the Spring Boot BOM, and add Spring Boot 4.1 to the system test matrix. Fixes GH-5561 Co-Authored-By: Claude <noreply@anthropic.com> * changelog * build: Bump Kotlin to 2.3.21 Align the global Kotlin version with Spring Boot 4.1 and remove the now-unneeded Spring 7 BOM override. Also remove unused Spring 7-specific Kotlin aliases from the version catalog. Co-Authored-By: Claude <noreply@anthropic.com> * docs(changelog): Move bump entry to Unreleased and add version details Move the Spring Boot 4 / OpenTelemetry dependency bump entry from 8.44.1 to the Unreleased section and add sub-list items showing each dependency version change. Co-Authored-By: Claude <noreply@anthropic.com> * fix(spring): Fix Spring 7 sample test compilation in SB4 matrix The Spring 7 sample had two dependency issues causing compileTestKotlin to fail in the Spring Boot 4.x CI matrix: 1. Used libs.springboot.starter.test (Spring Boot 2.7.18) instead of libs.springboot4.starter.test, mixing Spring Framework 5.x test utilities with a Spring Framework 7.x runtime. 2. Missing Kotlin BOM import in dependencyManagement. Without it, Spring Boot 4.0.0's BOM downgraded kotlin-stdlib to 2.2.21 while the compiler and build tools remained at 2.3.21, causing ClasspathEntrySnapshotTransform initialization failures. Co-Authored-By: Claude <noreply@anthropic.com> * mention BOM in changelog --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3199ff8 commit a979f23

4 files changed

Lines changed: 25 additions & 17 deletions

File tree

.github/workflows/spring-boot-4-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
springboot-version: [ '4.0.0', '4.0.5' ]
24+
springboot-version: [ '4.0.0', '4.0.5', '4.1.0' ]
2525

2626
name: Spring Boot ${{ matrix.springboot-version }}
2727
env:

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434

3535
### Dependencies
3636

37+
- Bump OpenTelemetry to support Spring Boot 4.1 ([#5573](https://github.com/getsentry/sentry-java/pull/5573))
38+
- If this causes issues for you because you are also using Spring Boot Dependency Management Plugin (io.spring.dependency-management),
39+
which may downgrade the OpenTelemetry SDK, please have a look at the changelog entry above that explains how to use `sentry-opentelemetry-bom`.
40+
- OpenTelemetry to 1.63.0 (was 1.60.1)
41+
- OpenTelemetry Instrumentation to 2.29.0 (was 2.26.0)
42+
- OpenTelemetry Instrumentation Alpha to 2.29.0-alpha (was 2.26.0-alpha)
43+
- OpenTelemetry Semantic Conventions to 1.42.0 (was 1.40.0)
44+
- OpenTelemetry Semantic Conventions Alpha to 1.42.0-alpha (was 1.40.0-alpha)
3745
- Bump Native SDK from v0.15.2 to v0.15.3 ([#5728](https://github.com/getsentry/sentry-java/pull/5728))
3846
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0153)
3947
- [diff](https://github.com/getsentry/sentry-native/compare/0.15.2...0.15.3)

gradle/libs.versions.toml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ feign = "11.6"
1313
gummyBears = "0.12.0"
1414
jackson = "2.18.3"
1515
jetbrainsCompose = "1.6.11"
16-
kotlin = "2.2.0"
17-
kotlinSpring7 = "2.2.0"
16+
kotlin = "2.3.21"
1817
kotlin-compatible-version = "1.9"
1918
ksp = "2.3.9"
2019
ktorClient = "3.0.0"
@@ -25,25 +24,24 @@ nopen = "1.0.1"
2524
# see https://developer.android.com/jetpack/androidx/releases/compose-kotlin
2625
okhttp = "4.9.2"
2726
openfeature = "1.18.2"
28-
otel = "1.60.1"
29-
# Keep alpha OpenTelemetry BOMs in sync with their stable counterparts: <stable-version>-alpha.
30-
otelAlpha = "1.60.1-alpha"
31-
otelInstrumentation = "2.26.0"
32-
otelInstrumentationAlpha = "2.26.0-alpha"
27+
otel = "1.63.0"
28+
otelAlpha = "1.63.0-alpha"
29+
otelInstrumentation = "2.29.0"
30+
otelInstrumentationAlpha = "2.29.0-alpha"
3331
# check https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/dependencyManagement/build.gradle.kts#L49 for release version above to find a compatible version
34-
otelSemanticConventions = "1.40.0"
35-
otelSemanticConventionsAlpha = "1.40.0-alpha"
32+
otelSemanticConventions = "1.42.0"
33+
otelSemanticConventionsAlpha = "1.42.0-alpha"
3634
retrofit = "2.9.0"
3735
room2 = "2.8.4"
3836
room3 = "3.0.0-rc01"
3937
sagp = "6.13.0"
4038
sqlite = "2.6.2"
4139
sqliteRc = "2.7.0-rc01" # Required by Room3 3.0.0-rc*
4240
slf4j = "1.7.30"
43-
spotless = "8.4.0"
41+
spotless = "8.6.0"
4442
springboot2 = "2.7.18"
4543
springboot3 = "3.5.0"
46-
springboot4 = "4.0.0"
44+
springboot4 = "4.1.0"
4745
sqldelight = "2.3.2"
4846

4947
# Android
@@ -54,8 +52,6 @@ minSdk = "21"
5452
[plugins]
5553
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
5654
kotlin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
57-
kotlin-spring7 = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlinSpring7" }
58-
kotlin-jvm-spring7 = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlinSpring7" }
5955
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
6056
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
6157
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
@@ -132,7 +128,6 @@ jackson-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin"
132128
jetbrains-annotations = { module = "org.jetbrains:annotations", version = "23.0.0" }
133129
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" }
134130
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
135-
kotlin-test-junit-spring7 = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinSpring7" }
136131
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
137132
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
138133
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktorClient" }

sentry-samples/sentry-samples-spring-7/build.gradle.kts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ java.sourceCompatibility = JavaVersion.VERSION_17
2626

2727
java.targetCompatibility = JavaVersion.VERSION_17
2828

29-
dependencyManagement { imports { mavenBom(SpringBootPlugin.BOM_COORDINATES) } }
29+
dependencyManagement {
30+
imports {
31+
mavenBom(SpringBootPlugin.BOM_COORDINATES)
32+
mavenBom(libs.kotlin.bom.get().toString())
33+
}
34+
}
3035

3136
dependencies {
3237
implementation(Config.Libs.springWeb)
@@ -49,7 +54,7 @@ dependencies {
4954

5055
testImplementation(projects.sentrySystemTestSupport)
5156
testImplementation(libs.kotlin.test.junit)
52-
testImplementation(libs.springboot.starter.test) {
57+
testImplementation(libs.springboot4.starter.test) {
5358
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
5459
}
5560
}

0 commit comments

Comments
 (0)