Skip to content

Commit 3699cd5

Browse files
adinauergetsentry-botmarkushialexander-alderman-webb
authored
Add new modules for Spring 7 and Spring Boot 4 (#4601)
* Add new modules for Spring 7 and Spring Boot 4 * Fix Spring 7 and Spring Boot 4 modules (#4602) * Attempt to fix kotlin 2.2 issue (#4603) * Fix Spring 7 and Spring Boot 4 modules * Attempt to fix kotlin 2.2 issue * Second attempt to fix Kotlin 2.2 (#4610) * Second attempt to fix Kotlin 2.2 * Format code * Third attempt at fixing Kotlin 2.2 compat (#4613) --------- Co-authored-by: Sentry Github Bot <[email protected]> * Address compose-related issues * Fix tests for Spring 7 and Spring Boot 4 (#4614) * Second attempt to fix Kotlin 2.2 * Format code * Third attempt at fixing Kotlin 2.2 compat * Fix tests for Spring 7 and Spring Boot 4 * Move Spring 7 and Spring Boot 4 packages (#4615) * Move Spring 7 and Spring Boot 4 packages * Fix class not found due to OTel not supporting spring boot 4 yet (#4616) * Format code * some fixes * change kotlin 1.8 to 1.9 and some cleanup * ignore warnings about api level that is not relevant * fix optional dependencies in SentryAutoConfiguration * Update trace origin * Remove duplicate e2e test config * Update Strings for Spring 7 and Spring Boot 4 * Disable Spring Boot 4 agentless e2e tests for now --------- Co-authored-by: Sentry Github Bot <[email protected]> --------- Co-authored-by: Sentry Github Bot <[email protected]> Co-authored-by: markushi <[email protected]> * changelog * fix ci * add ignored span origins for Spring 7 and Spring Boot 4 * move changelog * Example how to fix version mismatch (#4642) * Fix ignored span origin * move changelog --------- Co-authored-by: Sentry Github Bot <[email protected]> Co-authored-by: markushi <[email protected]> Co-authored-by: Alex Alderman Webb <[email protected]>
1 parent aa4ffdc commit 3699cd5

File tree

308 files changed

+18627
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+18627
-206
lines changed

.craft.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ targets:
1919
maven:io.sentry:sentry:
2020
maven:io.sentry:sentry-spring:
2121
maven:io.sentry:sentry-spring-jakarta:
22+
# maven:io.sentry:sentry-spring-7:
2223
maven:io.sentry:sentry-spring-boot:
2324
maven:io.sentry:sentry-spring-boot-jakarta:
2425
maven:io.sentry:sentry-spring-boot-starter:
2526
maven:io.sentry:sentry-spring-boot-starter-jakarta:
27+
# maven:io.sentry:sentry-spring-boot-4:
28+
# maven:io.sentry:sentry-spring-boot-4-starter:
2629
maven:io.sentry:sentry-servlet:
2730
maven:io.sentry:sentry-servlet-jakarta:
2831
maven:io.sentry:sentry-logback:

.github/ISSUE_TEMPLATE/bug_report_java.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ body:
2424
- sentry-spring-boot-jakarta
2525
- sentry-spring-boot-starter
2626
- sentry-spring-boot-starter-jakarta
27+
- sentry-spring-boot-4
28+
- sentry-spring-boot-4-starter
2729
- sentry-spring
2830
- sentry-spring-jakarta
31+
- sentry-spring-7
2932
- sentry-logback
3033
- sentry-log4j2
3134
- sentry-graphql

.github/workflows/system-tests-backend.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ jobs:
6363
- sample: "sentry-samples-jul"
6464
agent: "false"
6565
agent-auto-init: "true"
66+
- sample: "sentry-samples-spring-boot-4"
67+
agent: "false"
68+
agent-auto-init: "true"
69+
- sample: "sentry-samples-spring-boot-4-webflux"
70+
agent: "false"
71+
agent-auto-init: "true"
72+
# - sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
73+
# agent: "false"
74+
# agent-auto-init: "true"
75+
- sample: "sentry-samples-spring-boot-4-opentelemetry"
76+
agent: "true"
77+
agent-auto-init: "true"
78+
- sample: "sentry-samples-spring-boot-4-opentelemetry"
79+
agent: "true"
80+
agent-auto-init: "false"
6681
- sample: "sentry-samples-spring-jakarta"
6782
agent: "false"
6883
agent-auto-init: "true"

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Features
6+
7+
- Add support for Spring Boot 4 and Spring 7 ([#4601](https://github.com/getsentry/sentry-java/pull/4601))
8+
- NOTE: Our `sentry-opentelemetry-agentless-spring` is not working yet for Spring Boot 4. Please use `sentry-opentelemetry-agent` until OpenTelemetry has support for Spring Boot 4.
9+
310
## 8.20.0
411

512
### Fixes

build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ plugins {
1818
alias(libs.plugins.kover) apply false
1919
alias(libs.plugins.vanniktech.maven.publish) apply false
2020
alias(libs.plugins.kotlin.android) apply false
21+
alias(libs.plugins.kotlin.multiplatform) apply false
22+
alias(libs.plugins.kotlin.jvm) apply false
23+
alias(libs.plugins.kotlin.spring) apply false
2124
alias(libs.plugins.buildconfig) apply false
2225
// dokka is required by gradle-maven-publish-plugin.
2326
alias(libs.plugins.dokka) apply false
2427
alias(libs.plugins.dokka.javadoc) apply false
25-
alias(libs.plugins.compose.compiler) apply false
28+
alias(libs.plugins.kotlin.compose) apply false
2629
alias(libs.plugins.errorprone) apply false
2730
alias(libs.plugins.gradle.versions) apply false
2831
alias(libs.plugins.spring.dependency.management) apply false
@@ -61,6 +64,7 @@ apiValidation {
6164
"sentry-samples-servlet",
6265
"sentry-samples-spring",
6366
"sentry-samples-spring-jakarta",
67+
"sentry-samples-spring-7",
6468
"sentry-samples-spring-boot",
6569
"sentry-samples-spring-boot-opentelemetry",
6670
"sentry-samples-spring-boot-opentelemetry-noagent",
@@ -69,6 +73,10 @@ apiValidation {
6973
"sentry-samples-spring-boot-jakarta-opentelemetry-noagent",
7074
"sentry-samples-spring-boot-webflux",
7175
"sentry-samples-spring-boot-webflux-jakarta",
76+
"sentry-samples-spring-boot-4",
77+
"sentry-samples-spring-boot-4-opentelemetry",
78+
"sentry-samples-spring-boot-4-opentelemetry-noagent",
79+
"sentry-samples-spring-boot-4-webflux",
7280
"sentry-samples-ktor-client",
7381
"sentry-uitest-android",
7482
"sentry-uitest-android-benchmark",

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ repositories {
99
}
1010

1111
tasks.withType<KotlinCompile>().configureEach {
12-
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
12+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
1313
}

buildSrc/src/main/java/Config.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import java.math.BigDecimal
44
object Config {
55
val AGP = System.getenv("VERSION_AGP") ?: "8.6.0"
66
val kotlinStdLib = "stdlib-jdk8"
7+
val kotlinTestJunit = "test-junit"
78

89
object BuildPlugins {
910
val androidGradle = "com.android.tools.build:gradle:$AGP"
@@ -53,10 +54,13 @@ object Config {
5354
val SENTRY_LOG4J2_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.log4j2"
5455
val SENTRY_SPRING_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring"
5556
val SENTRY_SPRING_JAKARTA_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring.jakarta"
57+
val SENTRY_SPRING_7_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring-7"
5658
val SENTRY_SPRING_BOOT_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring-boot"
5759
val SENTRY_SPRING_BOOT_STARTER_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring-boot-starter"
5860
val SENTRY_SPRING_BOOT_JAKARTA_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring-boot.jakarta"
5961
val SENTRY_SPRING_BOOT_STARTER_JAKARTA_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring-boot-starter.jakarta"
62+
val SENTRY_SPRING_BOOT_4_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring-boot-4"
63+
val SENTRY_SPRING_BOOT_4_STARTER_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring-boot-4-starter"
6064
val SENTRY_OPENTELEMETRY_BOOTSTRAP_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.bootstrap"
6165
val SENTRY_OPENTELEMETRY_CORE_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.core"
6266
val SENTRY_OPENTELEMETRY_AGENT_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.agent"

gradle/libs.versions.toml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ feign = "11.6"
1111
jacoco = "0.8.7"
1212
jackson = "2.18.3"
1313
jetbrainsCompose = "1.6.11"
14-
kotlin = "1.9.24"
15-
kotlin-compatible-version = "1.6"
14+
kotlin = "2.2.0"
15+
kotlinSpring7 = "2.2.0"
16+
kotlin-compatible-version = "1.9"
1617
ktorClient = "3.0.0"
1718
logback = "1.2.9"
1819
log4j2 = "2.20.0"
@@ -30,6 +31,7 @@ retrofit = "2.9.0"
3031
slf4j = "1.7.30"
3132
springboot2 = "2.7.18"
3233
springboot3 = "3.5.0"
34+
springboot4 = "4.0.0-M1"
3335
# Android
3436
targetSdk = "34"
3537
compileSdk = "34"
@@ -39,11 +41,15 @@ spotless = "7.0.4"
3941
[plugins]
4042
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
4143
kotlin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
44+
kotlin-spring7 = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlinSpring7" }
45+
kotlin-jvm-spring7 = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlinSpring7" }
46+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
47+
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
48+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
4249
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "5.6.5" }
4350
dokka = { id = "org.jetbrains.dokka", version = "2.0.0" }
4451
dokka-javadoc = { id = "org.jetbrains.dokka-javadoc", version = "2.0.0" }
4552
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.0" }
46-
compose-compiler = { id = "org.jetbrains.compose", version.ref = "jetbrainsCompose" }
4753
errorprone = { id = "net.ltgt.errorprone", version = "3.0.1" }
4854
gradle-versions = { id = "com.github.ben-manes.versions", version = "0.42.0" }
4955
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
@@ -53,6 +59,7 @@ kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.3" }
5359
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
5460
springboot2 = { id = "org.springframework.boot", version.ref = "springboot2" }
5561
springboot3 = { id = "org.springframework.boot", version.ref = "springboot3" }
62+
springboot4 = { id = "org.springframework.boot", version.ref = "springboot4" }
5663
spring-dependency-management = { id = "io.spring.dependency-management", version = "1.0.11.RELEASE" }
5764
gretty = { id = "org.gretty", version = "4.0.0" }
5865

@@ -93,7 +100,9 @@ graphql-java24 = { module = "com.graphql-java:graphql-java", version = "24.0" }
93100
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
94101
jackson-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" }
95102
jetbrains-annotations = { module = "org.jetbrains:annotations", version = "23.0.0" }
103+
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" }
96104
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
105+
kotlin-test-junit-spring7 = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinSpring7" }
97106
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
98107
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
99108
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktorClient" }
@@ -150,6 +159,20 @@ springboot3-starter-aop = { module = "org.springframework.boot:spring-boot-start
150159
springboot3-starter-security = { module = "org.springframework.boot:spring-boot-starter-security", version.ref = "springboot3" }
151160
springboot3-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot3" }
152161
springboot3-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot3" }
162+
springboot4-otel = { module = "io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter", version.ref = "otelInstrumentation" }
163+
springboot4-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot4" }
164+
springboot4-starter-graphql = { module = "org.springframework.boot:spring-boot-starter-graphql", version.ref = "springboot4" }
165+
springboot4-starter-quartz = { module = "org.springframework.boot:spring-boot-starter-quartz", version.ref = "springboot4" }
166+
springboot4-starter-test = { module = "org.springframework.boot:spring-boot-starter-test", version.ref = "springboot4" }
167+
springboot4-starter-web = { module = "org.springframework.boot:spring-boot-starter-web", version.ref = "springboot4" }
168+
springboot4-starter-websocket = { module = "org.springframework.boot:spring-boot-starter-websocket", version.ref = "springboot4" }
169+
springboot4-starter-webflux = { module = "org.springframework.boot:spring-boot-starter-webflux", version.ref = "springboot4" }
170+
springboot4-starter-aop = { module = "org.springframework.boot:spring-boot-starter-aop", version.ref = "springboot4" }
171+
springboot4-starter-security = { module = "org.springframework.boot:spring-boot-starter-security", version.ref = "springboot4" }
172+
springboot4-starter-restclient = { module = "org.springframework.boot:spring-boot-starter-restclient", version.ref = "springboot4" }
173+
springboot4-starter-webclient = { module = "org.springframework.boot:spring-boot-starter-webclient", version.ref = "springboot4" }
174+
springboot4-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot4" }
175+
springboot4-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot4" }
153176
timber = { module = "com.jakewharton.timber:timber", version = "4.7.1" }
154177

155178
# tomcat libraries
@@ -167,12 +190,14 @@ androidx-test-orchestrator = { module = "androidx.test:orchestrator", version =
167190
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestCore" }
168191
androidx-test-runner = { module = "androidx.test:runner", version = "1.6.2" }
169192
awaitility-kotlin = { module = "org.awaitility:awaitility-kotlin", version = "4.1.1" }
193+
awaitility-kotlin-spring7 = { module = "org.awaitility:awaitility-kotlin", version = "4.3.0" }
170194
awaitility3-kotlin = { module = "org.awaitility:awaitility-kotlin", version = "3.1.6" }
171195
hsqldb = { module = "org.hsqldb:hsqldb", version = "2.6.1" }
172196
javafaker = { module = "com.github.javafaker:javafaker", version = "1.0.2" }
173197
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
174198
leakcanary-instrumentation = { module = "com.squareup.leakcanary:leakcanary-android-instrumentation", version = "2.14" }
175199
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version = "4.1.0" }
200+
mockito-kotlin-spring7 = { module = "org.mockito.kotlin:mockito-kotlin", version = "6.0.0" }
176201
mockito-inline = { module = "org.mockito:mockito-inline", version = "4.8.0" }
177202
msgpack = { module = "org.msgpack:msgpack-core", version = "0.9.8" }
178203
okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }

sentry-android-core/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import org.jetbrains.kotlin.config.KotlinCompilerVersion
33

44
plugins {
55
id("com.android.library")
6-
kotlin("android")
6+
alias(libs.plugins.kotlin.android)
77
jacoco
88
alias(libs.plugins.jacoco.android)
99
alias(libs.plugins.errorprone)
@@ -34,7 +34,7 @@ android {
3434
getByName("release") { consumerProguardFiles("proguard-rules.pro") }
3535
}
3636

37-
kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() }
37+
kotlin { compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 }
3838

3939
testOptions {
4040
animationsDisabled = true

sentry-android-fragment/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import io.gitlab.arturbosch.detekt.Detekt
22

33
plugins {
44
id("com.android.library")
5-
kotlin("android")
5+
alias(libs.plugins.kotlin.android)
66
jacoco
77
alias(libs.plugins.jacoco.android)
88
alias(libs.plugins.gradle.versions)
@@ -25,7 +25,11 @@ android {
2525
getByName("release") { consumerProguardFiles("proguard-rules.pro") }
2626
}
2727

28-
kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() }
28+
kotlin {
29+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
30+
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
31+
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
32+
}
2933

3034
testOptions {
3135
animationsDisabled = true

0 commit comments

Comments
 (0)