Skip to content

Commit 741c273

Browse files
authored
Merge 1137d60 into 48277cd
2 parents 48277cd + 1137d60 commit 741c273

23 files changed

Lines changed: 300 additions & 113 deletions

File tree

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,16 @@ jobs:
6262

6363
- name: Update Spring Boot 2.x version
6464
run: |
65-
sed -i 's/^springboot2=.*/springboot2=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
66-
echo "Updated Spring Boot 2.x version to ${{ matrix.springboot-version }}"
65+
springboot_version="${{ matrix.springboot-version }}"
66+
if [[ "$springboot_version" =~ ^2\.[0-3]\. ]]; then
67+
springboot_version="${springboot_version}.RELEASE"
68+
fi
69+
if [[ ! "$springboot_version" =~ ^2\.7\. ]]; then
70+
echo "ORG_GRADLE_PROJECT_excludeGraphql=true" >> "$GITHUB_ENV"
71+
echo "ORG_GRADLE_PROJECT_excludeKafka=true" >> "$GITHUB_ENV"
72+
fi
73+
sed -i 's/^\(springboot2[[:space:]]*=[[:space:]]*\)".*"/\1"'"$springboot_version"'"/' gradle/libs.versions.toml
74+
echo "Updated Spring Boot 2.x version to $springboot_version"
6775
6876
- name: Exclude android modules from build
6977
run: |
@@ -133,6 +141,7 @@ jobs:
133141
--build "true"
134142
135143
- name: Test sentry-samples-spring-boot-opentelemetry-noagent
144+
if: ${{ !startsWith(matrix.springboot-version, '2.1.') && !startsWith(matrix.springboot-version, '2.2.') }}
136145
run: |
137146
python3 test/system-test-runner.py test \
138147
--module "sentry-samples-spring-boot-opentelemetry-noagent" \

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
springboot-version: [ '3.0.0', '3.2.12', '3.3.13', '3.4.13', '3.5.13' ]
22+
springboot-version: [ '3.2.12', '3.3.13', '3.4.13', '3.5.13' ]
2323

2424
name: Spring Boot ${{ matrix.springboot-version }}
2525
env:
@@ -62,7 +62,7 @@ jobs:
6262

6363
- name: Update Spring Boot 3.x version
6464
run: |
65-
sed -i 's/^springboot3=.*/springboot3=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
65+
sed -i 's/^\(springboot3[[:space:]]*=[[:space:]]*\)".*"/\1"${{ matrix.springboot-version }}"/' gradle/libs.versions.toml
6666
echo "Updated Spring Boot 3.x version to ${{ matrix.springboot-version }}"
6767
6868
- name: Exclude android modules from build

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
- name: Update Spring Boot 4.x version
6464
run: |
65-
sed -i 's/^springboot4=.*/springboot4=${{ matrix.springboot-version }}/' gradle/libs.versions.toml
65+
sed -i 's/^\(springboot4[[:space:]]*=[[:space:]]*\)".*"/\1"${{ matrix.springboot-version }}"/' gradle/libs.versions.toml
6666
echo "Updated Spring Boot 4.x version to ${{ matrix.springboot-version }}"
6767
6868
- name: Exclude android modules from build

gradle/libs.versions.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ retrofit = "2.9.0"
3232
slf4j = "1.7.30"
3333
springboot2 = "2.7.18"
3434
springboot3 = "3.5.0"
35+
springboot3Plugin = "3.5.0"
3536
springboot4 = "4.0.0"
3637
# Android
3738
targetSdk = "36"
@@ -61,7 +62,7 @@ detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.8" }
6162
jacoco-android = { id = "com.mxalbert.gradle.jacoco-android", version = "0.2.0" }
6263
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.3" }
6364
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
64-
springboot3 = { id = "org.springframework.boot", version.ref = "springboot3" }
65+
springboot3 = { id = "org.springframework.boot", version.ref = "springboot3Plugin" }
6566
springboot4 = { id = "org.springframework.boot", version.ref = "springboot4" }
6667
spring-dependency-management = { id = "io.spring.dependency-management", version = "1.1.7" }
6768
gretty = { id = "org.gretty", version = "4.0.0" }
@@ -160,6 +161,7 @@ slf4j2-api = { module = "org.slf4j:slf4j-api", version = "2.0.5" }
160161
spotlessLib = { module = "com.diffplug.spotless:com.diffplug.spotless.gradle.plugin", version.ref = "spotless"}
161162
springboot2-bom = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "springboot2" }
162163
springboot-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot2" }
164+
spring-graphql = { module = "org.springframework.graphql:spring-graphql", version = "1.0.6" }
163165
springboot-starter-graphql = { module = "org.springframework.boot:spring-boot-starter-graphql", version.ref = "springboot2" }
164166
springboot-starter-quartz = { module = "org.springframework.boot:spring-boot-starter-quartz", version.ref = "springboot2" }
165167
springboot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test", version.ref = "springboot2" }

sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ java.targetCompatibility = JavaVersion.VERSION_17
1818

1919
repositories { mavenCentral() }
2020

21+
dependencyManagement {
22+
imports {
23+
mavenBom("org.springframework.boot:spring-boot-dependencies:${libs.versions.springboot3.get()}")
24+
mavenBom(libs.otel.instrumentation.bom.get().toString())
25+
}
26+
}
27+
2128
// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
2229
extra["kotlin-coroutines.version"] = "1.9.0"
2330

@@ -79,8 +86,6 @@ dependencies {
7986
testImplementation("ch.qos.logback:logback-core:1.5.16")
8087
}
8188

82-
dependencyManagement { imports { mavenBom(libs.otel.instrumentation.bom.get().toString()) } }
83-
8489
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
8590

8691
tasks.register<Test>("systemTest").configure {

sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ java.targetCompatibility = JavaVersion.VERSION_17
1919

2020
repositories { mavenCentral() }
2121

22+
dependencyManagement {
23+
imports {
24+
mavenBom("org.springframework.boot:spring-boot-dependencies:${libs.versions.springboot3.get()}")
25+
}
26+
}
27+
2228
// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
2329
extra["kotlin-coroutines.version"] = "1.9.0"
2430

sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ java.targetCompatibility = JavaVersion.VERSION_17
1818

1919
repositories { mavenCentral() }
2020

21+
dependencyManagement {
22+
imports {
23+
mavenBom("org.springframework.boot:spring-boot-dependencies:${libs.versions.springboot3.get()}")
24+
}
25+
}
26+
2127
// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
2228
extra["kotlin-coroutines.version"] = "1.9.0"
2329

sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,37 @@ group = "io.sentry.sample.spring-boot"
1515

1616
version = "0.0.1-SNAPSHOT"
1717

18-
java.sourceCompatibility = JavaVersion.VERSION_17
18+
java.sourceCompatibility = JavaVersion.VERSION_11
1919

20-
java.targetCompatibility = JavaVersion.VERSION_17
20+
java.targetCompatibility = JavaVersion.VERSION_11
2121

2222
repositories { mavenCentral() }
2323

24+
fun springBoot2SupportsOptionalIntegrations(): Boolean {
25+
val version = libs.versions.springboot2.get().removeSuffix(".RELEASE")
26+
val parts = version.split(".").map { it.toIntOrNull() ?: 0 }
27+
val major = parts.getOrElse(0) { 0 }
28+
val minor = parts.getOrElse(1) { 0 }
29+
return major > 2 || (major == 2 && minor >= 7)
30+
}
31+
32+
val includeGraphql =
33+
!project.hasProperty("excludeGraphql") && springBoot2SupportsOptionalIntegrations()
34+
val includeKafka = !project.hasProperty("excludeKafka") && springBoot2SupportsOptionalIntegrations()
35+
2436
configure<JavaPluginExtension> {
25-
sourceCompatibility = JavaVersion.VERSION_17
26-
targetCompatibility = JavaVersion.VERSION_17
37+
sourceCompatibility = JavaVersion.VERSION_11
38+
targetCompatibility = JavaVersion.VERSION_11
2739
}
2840

2941
tasks.withType<KotlinCompile>().configureEach {
30-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
42+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
3143
}
3244

3345
tasks.withType<KotlinCompile>().configureEach {
3446
kotlin {
3547
compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
36-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
48+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
3749
}
3850
}
3951

@@ -43,7 +55,9 @@ dependencies {
4355
implementation(libs.springboot.starter)
4456
implementation(libs.springboot.starter.actuator)
4557
implementation(libs.springboot.starter.aop)
46-
implementation(libs.springboot.starter.graphql)
58+
if (includeGraphql) {
59+
implementation(libs.springboot.starter.graphql)
60+
}
4761
implementation(libs.springboot.starter.jdbc)
4862
implementation(libs.springboot.starter.quartz)
4963
implementation(libs.springboot.starter.security)
@@ -55,14 +69,17 @@ dependencies {
5569
implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
5670
implementation(projects.sentrySpringBootStarter)
5771
implementation(projects.sentryLogback)
58-
implementation(projects.sentryGraphql)
72+
if (includeGraphql) {
73+
implementation(projects.sentryGraphql)
74+
}
5975
implementation(projects.sentryQuartz)
6076
implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentlessSpring)
6177
implementation(projects.sentryAsyncProfiler)
6278

63-
// kafka
64-
implementation(libs.spring.kafka2)
65-
implementation(projects.sentryKafka)
79+
if (includeKafka) {
80+
implementation(libs.spring.kafka2)
81+
implementation(projects.sentryKafka)
82+
}
6683

6784
// database query tracing
6885
implementation(projects.sentryJdbc)
@@ -103,7 +120,19 @@ tasks.jar {
103120

104121
tasks.startScripts { dependsOn(tasks.shadowJar) }
105122

106-
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
123+
configure<SourceSetContainer> {
124+
main {
125+
if (!includeGraphql) {
126+
java.exclude("**/graphql/**")
127+
resources.exclude("graphql/**")
128+
}
129+
if (!includeKafka) {
130+
java.exclude("**/queues/kafka/**")
131+
resources.exclude("application-kafka.properties")
132+
}
133+
}
134+
test { java.srcDir("src/test/java") }
135+
}
107136

108137
tasks.register<Test>("systemTest").configure {
109138
group = "verification"
@@ -121,7 +150,15 @@ tasks.register<Test>("systemTest").configure {
121150
minHeapSize = "128m"
122151
maxHeapSize = "1g"
123152

124-
filter { includeTestsMatching("io.sentry.systemtest*") }
153+
filter {
154+
includeTestsMatching("io.sentry.systemtest*")
155+
if (!includeGraphql) {
156+
excludeTestsMatching("io.sentry.systemtest.Graphql*")
157+
}
158+
if (!includeKafka) {
159+
excludeTestsMatching("io.sentry.systemtest.Kafka*")
160+
}
161+
}
125162
}
126163

127164
tasks.named("test").configure {

sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,34 @@ group = "io.sentry.sample.spring-boot"
1515

1616
version = "0.0.1-SNAPSHOT"
1717

18-
java.sourceCompatibility = JavaVersion.VERSION_17
18+
java.sourceCompatibility = JavaVersion.VERSION_11
1919

20-
java.targetCompatibility = JavaVersion.VERSION_17
20+
java.targetCompatibility = JavaVersion.VERSION_11
2121

2222
repositories { mavenCentral() }
2323

24+
fun springBoot2SupportsOptionalIntegrations(): Boolean {
25+
val version = libs.versions.springboot2.get().removeSuffix(".RELEASE")
26+
val parts = version.split(".").map { it.toIntOrNull() ?: 0 }
27+
val major = parts.getOrElse(0) { 0 }
28+
val minor = parts.getOrElse(1) { 0 }
29+
return major > 2 || (major == 2 && minor >= 7)
30+
}
31+
32+
val includeGraphql =
33+
!project.hasProperty("excludeGraphql") && springBoot2SupportsOptionalIntegrations()
34+
val includeKafka = !project.hasProperty("excludeKafka") && springBoot2SupportsOptionalIntegrations()
35+
2436
configure<JavaPluginExtension> {
25-
sourceCompatibility = JavaVersion.VERSION_17
26-
targetCompatibility = JavaVersion.VERSION_17
37+
sourceCompatibility = JavaVersion.VERSION_11
38+
targetCompatibility = JavaVersion.VERSION_11
2739
}
2840

2941
tasks.withType<KotlinCompile>().configureEach {
30-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
42+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
3143
kotlin {
3244
compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
33-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
45+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
3446
}
3547
}
3648

@@ -39,7 +51,9 @@ dependencies {
3951
implementation(libs.springboot.starter)
4052
implementation(libs.springboot.starter.actuator)
4153
implementation(libs.springboot.starter.aop)
42-
implementation(libs.springboot.starter.graphql)
54+
if (includeGraphql) {
55+
implementation(libs.springboot.starter.graphql)
56+
}
4357
implementation(libs.springboot.starter.jdbc)
4458
implementation(libs.springboot.starter.quartz)
4559
implementation(libs.springboot.starter.security)
@@ -51,14 +65,17 @@ dependencies {
5165
implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
5266
implementation(projects.sentrySpringBootStarter)
5367
implementation(projects.sentryLogback)
54-
implementation(projects.sentryGraphql)
68+
if (includeGraphql) {
69+
implementation(projects.sentryGraphql)
70+
}
5571
implementation(projects.sentryQuartz)
5672
implementation(projects.sentryAsyncProfiler)
5773
implementation(libs.otel)
5874

59-
// kafka
60-
implementation(libs.spring.kafka2)
61-
implementation(projects.sentryKafka)
75+
if (includeKafka) {
76+
implementation(libs.spring.kafka2)
77+
implementation(projects.sentryKafka)
78+
}
6279

6380
// database query tracing
6481
implementation(projects.sentryJdbc)
@@ -99,7 +116,19 @@ tasks.jar {
99116

100117
tasks.startScripts { dependsOn(tasks.shadowJar) }
101118

102-
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
119+
configure<SourceSetContainer> {
120+
main {
121+
if (!includeGraphql) {
122+
java.exclude("**/graphql/**")
123+
resources.exclude("graphql/**")
124+
}
125+
if (!includeKafka) {
126+
java.exclude("**/queues/kafka/**")
127+
resources.exclude("application-kafka.properties")
128+
}
129+
}
130+
test { java.srcDir("src/test/java") }
131+
}
103132

104133
tasks.register<JavaExec>("bootRunWithAgent").configure {
105134
group = "application"
@@ -141,7 +170,15 @@ tasks.register<Test>("systemTest").configure {
141170
minHeapSize = "128m"
142171
maxHeapSize = "1g"
143172

144-
filter { includeTestsMatching("io.sentry.systemtest*") }
173+
filter {
174+
includeTestsMatching("io.sentry.systemtest*")
175+
if (!includeGraphql) {
176+
excludeTestsMatching("io.sentry.systemtest.Graphql*")
177+
}
178+
if (!includeKafka) {
179+
excludeTestsMatching("io.sentry.systemtest.Kafka*")
180+
}
181+
}
145182
}
146183

147184
tasks.named("test").configure {

sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ java.targetCompatibility = JavaVersion.VERSION_17
1818

1919
repositories { mavenCentral() }
2020

21+
dependencyManagement {
22+
imports {
23+
mavenBom("org.springframework.boot:spring-boot-dependencies:${libs.versions.springboot3.get()}")
24+
}
25+
}
26+
2127
// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
2228
extra["kotlin-coroutines.version"] = "1.9.0"
2329

0 commit comments

Comments
 (0)