From c1441b5a8c5a1c377842d5772ba3ca4c4d1ea986 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 27 Oct 2026 13:12:07 +0100 Subject: [PATCH 1/7] build(samples): Move the JVM samples to their own build The 28 JVM samples are now a standalone Gradle build in sentry-samples that includes the SDK build, like the Android sample and the Android integration tests. They depend on io.sentry:* coordinates, which Gradle substitutes with the SDK's projects. The SDK build doesn't include them back, so the Spring Boot, gretty and shadow plugins the samples apply no longer load in the SDK build. The three bootRunWithAgent tasks find the agent jar from the repository root and take the SDK version from the catalog, since the samples build has its own root directory and gradle.properties. With no samples or integration tests left in the SDK build, the name filters that skipped them for publishing and CodeQL go too. Root check and spotlessApply no longer reach the samples, so preMerge runs this build's check, which covers what the root check ran for them: compilation, jars and spotless. The format workflow runs its spotlessApply. Co-Authored-By: Claude Opus 5.5 --- .cursor/rules/new_module.mdc | 14 +--- AGENTS.md | 5 +- Makefile | 10 ++- build.gradle.kts | 6 +- sentry-samples/build.gradle.kts | 15 ++++ sentry-samples/gradle.properties | 13 +++ .../build.gradle.kts | 6 +- .../build.gradle.kts | 6 +- .../sentry-samples-console/build.gradle.kts | 10 ++- .../sentry-samples-jul/build.gradle.kts | 4 +- .../build.gradle.kts | 6 +- .../sentry-samples-log4j2/build.gradle.kts | 4 +- .../sentry-samples-logback/build.gradle.kts | 4 +- .../build.gradle.kts | 6 +- .../sentry-samples-openfeign/build.gradle.kts | 6 +- .../sentry-samples-servlet/build.gradle.kts | 4 +- .../sentry-samples-spring-7/build.gradle.kts | 8 +- .../build.gradle.kts | 16 ++-- .../build.gradle.kts | 18 ++-- .../build.gradle.kts | 19 +++-- .../build.gradle.kts | 16 ++-- .../build.gradle.kts | 12 +-- .../build.gradle.kts | 18 ++-- .../build.gradle.kts | 18 ++-- .../build.gradle.kts | 18 ++-- .../build.gradle.kts | 19 +++-- .../build.gradle.kts | 20 +++-- .../build.gradle.kts | 18 ++-- .../build.gradle.kts | 19 +++-- .../build.gradle.kts | 12 +-- .../build.gradle.kts | 10 ++- .../build.gradle.kts | 18 ++-- .../build.gradle.kts | 8 +- .../sentry-samples-spring/build.gradle.kts | 8 +- sentry-samples/settings.gradle.kts | 84 +++++++++++++++++++ settings.gradle.kts | 30 +------ 36 files changed, 323 insertions(+), 185 deletions(-) create mode 100644 sentry-samples/build.gradle.kts create mode 100644 sentry-samples/gradle.properties create mode 100644 sentry-samples/settings.gradle.kts diff --git a/.cursor/rules/new_module.mdc b/.cursor/rules/new_module.mdc index b9fdde3df6a..a190240f7fb 100644 --- a/.cursor/rules/new_module.mdc +++ b/.cursor/rules/new_module.mdc @@ -31,16 +31,10 @@ the release that first ships it. All of the following have to be merged **before 2. Add the module to the include list in `settings.gradle.kts` -If adding a `sentry-samples` module, also add it to the `ignoredProjects` list in the root `build.gradle.kts`: - -```kotlin -ignoredProjects.addAll( - listOf( - // ... existing projects ... - "sentry-samples-{module-name}" - ) -) -``` +If adding a sample, add it to the include list in `sentry-samples/settings.gradle.kts` instead. The +samples are a separate Gradle build that includes the SDK build, so a sample depends on +`"io.sentry:sentry-{module-name}:$sentryVersion"` (with `val sentryVersion = +libs.versions.sentry.get()`), and Gradle substitutes the SDK's project for it. 3. Add a `SENTRY_{MODULE}_SDK_NAME` constant to the `Config.Sentry` block in `buildSrc/src/main/java/Config.kt`: diff --git a/AGENTS.md b/AGENTS.md index ee6436f8d23..556d8f35961 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -67,6 +67,9 @@ resolves the per-module test task, including integration test suites, for you. # Build the Android sample, a separate Gradle build that includes this one ./gradlew -p sentry-samples/sentry-samples-android assembleDebug + +# Build the JVM samples, another separate Gradle build that includes this one +./gradlew -p sentry-samples assemble ``` ## Development Workflow Rules @@ -113,7 +116,7 @@ The repository is organized into multiple modules: ### Utility Modules - **`sentry-test-support`** - Shared test utilities, including `MockSentryServer` and envelope matchers -- **`sentry-samples`** - Example applications. `sentry-samples-android` is a separate Gradle build that includes this one, so root tasks such as `check` and `spotlessApply` don't reach it +- **`sentry-samples`** - Example applications, in two separate Gradle builds that include this one: `sentry-samples` (JVM) and `sentry-samples/sentry-samples-android`. Root tasks such as `check` and `spotlessApply` don't reach them, and `sentry-android-integration-tests` is a separate build too - **`sentry-bom`** - Bill of Materials for dependency management ### Key Architectural Patterns diff --git a/Makefile b/Makefile index d88f81d09ab..fe1f3c5c9f0 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -.PHONY: all clean compile javadocs dryRelease update format checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical check preMerge publish +.PHONY: all clean compile javadocs dryRelease update format checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical check checkSamples preMerge publish all: stop clean javadocs compile assembleUiTests: assembleUiTestRelease -preMerge: check +preMerge: check checkSamples publish: clean dryRelease # deep clean @@ -28,12 +28,14 @@ update: # Spotless formats the code. The root spotlessApply doesn't reach the separate builds. format: ./gradlew spotlessApply + ./gradlew -p sentry-samples spotlessApply ./gradlew -p sentry-samples/sentry-samples-android spotlessApply ./gradlew -p sentry-android-integration-tests spotlessApply # Spotless check's code checkFormat: ./gradlew spotlessJavaCheck spotlessKotlinCheck + ./gradlew -p sentry-samples spotlessJavaCheck spotlessKotlinCheck ./gradlew -p sentry-samples/sentry-samples-android spotlessJavaCheck spotlessKotlinCheck ./gradlew -p sentry-android-integration-tests spotlessJavaCheck spotlessKotlinCheck @@ -56,3 +58,7 @@ runUiTestCritical: # Run tests and lint check: ./gradlew check + +# The samples are separate builds, so the root `check` doesn't reach them +checkSamples: + ./gradlew -p sentry-samples check diff --git a/build.gradle.kts b/build.gradle.kts index 27a81c7a9a6..c084280e7d1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -67,7 +67,7 @@ subprojects { } } - if (!this.name.contains("sample") && !this.name.contains("integration-tests") && this.name != "sentry-test-support") { + if (this.name != "sentry-test-support") { apply() apply() @@ -147,9 +147,7 @@ subprojects { tasks.register("buildForCodeQL") { subprojects .filter { - !it.displayName.contains("sample") && - !it.displayName.contains("integration-tests") && - !it.displayName.contains("bom") && + !it.displayName.contains("bom") && it.name != "sentry-opentelemetry" } .forEach { proj -> diff --git a/sentry-samples/build.gradle.kts b/sentry-samples/build.gradle.kts new file mode 100644 index 00000000000..378180567e1 --- /dev/null +++ b/sentry-samples/build.gradle.kts @@ -0,0 +1,15 @@ +// Loads the shared plugins once for every sample, so they all share one classpath. The Spring Boot +// plugin is applied in each sample instead, because the samples use different versions of it. +plugins { + alias(libs.plugins.kotlin.jvm) apply false + alias(libs.plugins.kotlin.spring) apply false + alias(libs.plugins.spring.dependency.management) apply false + alias(libs.plugins.gradle.versions) apply false + id("io.sentry.spotless") apply false + id("io.sentry.jdk-target") apply false +} + +subprojects { + apply(plugin = "io.sentry.spotless") + apply(plugin = "io.sentry.jdk-target") +} diff --git a/sentry-samples/gradle.properties b/sentry-samples/gradle.properties new file mode 100644 index 00000000000..d4b4b304bdc --- /dev/null +++ b/sentry-samples/gradle.properties @@ -0,0 +1,13 @@ +# Gradle properties are per build, so this repeats what the samples need from the SDK build's +# gradle.properties. settings.gradle.kts reads the SDK version from that file. + +org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=2g -XX:+CrashOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC +org.gradle.caching=true +org.gradle.parallel=true +org.gradle.configureondemand=true +org.gradle.configuration-cache=true +org.gradle.configuration-cache.parallel=true + +kotlin.stdlib.default.dependency=false + +systemProp.org.gradle.internal.http.socketTimeout=120000 diff --git a/sentry-samples/sentry-samples-console-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-console-opentelemetry-noagent/build.gradle.kts index 7bac9a5a200..b72ae75ca6a 100644 --- a/sentry-samples/sentry-samples-console-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-console-opentelemetry-noagent/build.gradle.kts @@ -5,11 +5,13 @@ plugins { alias(libs.plugins.shadow) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.console.Main") } dependencies { - implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentless) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-opentelemetry-agentless:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") } // Configure the Shadow JAR (executable JAR with all dependencies) diff --git a/sentry-samples/sentry-samples-console-otlp/build.gradle.kts b/sentry-samples/sentry-samples-console-otlp/build.gradle.kts index 134697014b7..060aae8979c 100644 --- a/sentry-samples/sentry-samples-console-otlp/build.gradle.kts +++ b/sentry-samples/sentry-samples-console-otlp/build.gradle.kts @@ -5,11 +5,13 @@ plugins { alias(libs.plugins.shadow) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.console.Main") } dependencies { - implementation(projects.sentryOpentelemetry.sentryOpentelemetryOtlp) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-opentelemetry-otlp:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") implementation(libs.otel.semconv) implementation(libs.otel.semconv.incubating) implementation(libs.otel.exporter.logging) diff --git a/sentry-samples/sentry-samples-console/build.gradle.kts b/sentry-samples/sentry-samples-console/build.gradle.kts index d691d7ceb24..a1e96c725b3 100644 --- a/sentry-samples/sentry-samples-console/build.gradle.kts +++ b/sentry-samples/sentry-samples-console/build.gradle.kts @@ -5,13 +5,15 @@ plugins { alias(libs.plugins.shadow) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.console.Main") } dependencies { - implementation(projects.sentry) - implementation(projects.sentryAsyncProfiler) - implementation(projects.sentryJcache) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") + implementation("io.sentry:sentry-jcache:$sentryVersion") + implementation("io.sentry:sentry-kafka:$sentryVersion") implementation(libs.jcache) implementation(libs.caffeine.jcache) implementation(libs.kafka.clients) diff --git a/sentry-samples/sentry-samples-jul/build.gradle.kts b/sentry-samples/sentry-samples-jul/build.gradle.kts index 981455c455e..78495a72203 100644 --- a/sentry-samples/sentry-samples-jul/build.gradle.kts +++ b/sentry-samples/sentry-samples-jul/build.gradle.kts @@ -5,10 +5,12 @@ plugins { alias(libs.plugins.shadow) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.jul.Main") } dependencies { - implementation(projects.sentryJul) + implementation("io.sentry:sentry-jul:$sentryVersion") implementation(libs.slf4j.jdk14) } diff --git a/sentry-samples/sentry-samples-ktor-client/build.gradle.kts b/sentry-samples/sentry-samples-ktor-client/build.gradle.kts index 08a08b01c88..9b89d6cd46a 100644 --- a/sentry-samples/sentry-samples-ktor-client/build.gradle.kts +++ b/sentry-samples/sentry-samples-ktor-client/build.gradle.kts @@ -4,6 +4,8 @@ plugins { alias(libs.plugins.gradle.versions) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.ktorClient.Main") } configure { @@ -19,8 +21,8 @@ dependencies { implementation(libs.ktor.client.core) implementation(libs.ktor.client.java) implementation(libs.kotlinx.coroutines) - implementation(projects.sentry) - implementation(projects.sentryKtorClient) + implementation("io.sentry:sentry:$sentryVersion") + implementation("io.sentry:sentry-ktor-client:$sentryVersion") } tasks.test { useJUnitPlatform() } diff --git a/sentry-samples/sentry-samples-log4j2/build.gradle.kts b/sentry-samples/sentry-samples-log4j2/build.gradle.kts index d320d2b3334..3fa6dfcf986 100644 --- a/sentry-samples/sentry-samples-log4j2/build.gradle.kts +++ b/sentry-samples/sentry-samples-log4j2/build.gradle.kts @@ -5,10 +5,12 @@ plugins { alias(libs.plugins.shadow) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.log4j2.Main") } dependencies { - implementation(projects.sentryLog4j2) + implementation("io.sentry:sentry-log4j2:$sentryVersion") implementation(libs.log4j.api) implementation(libs.log4j.core) } diff --git a/sentry-samples/sentry-samples-logback/build.gradle.kts b/sentry-samples/sentry-samples-logback/build.gradle.kts index 12644bf2ded..d192ba37aaa 100644 --- a/sentry-samples/sentry-samples-logback/build.gradle.kts +++ b/sentry-samples/sentry-samples-logback/build.gradle.kts @@ -5,10 +5,12 @@ plugins { alias(libs.plugins.shadow) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.logback.Main") } dependencies { - implementation(projects.sentryLogback) + implementation("io.sentry:sentry-logback:$sentryVersion") implementation(libs.logback.classic) } diff --git a/sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts b/sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts index e7ddb9dad92..7ffbb6d234c 100644 --- a/sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts +++ b/sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts @@ -10,6 +10,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.netflix.dgs.NetlixDgsApplication") } group = "io.sentry.sample.spring-boot" @@ -25,8 +27,8 @@ dependencies { implementation(libs.springboot.starter.web) implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarter) - implementation(projects.sentryGraphql) + implementation("io.sentry:sentry-spring-boot-starter:$sentryVersion") + implementation("io.sentry:sentry-graphql:$sentryVersion") implementation(platform("com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:4.9.2")) implementation("com.netflix.graphql.dgs:graphql-dgs-subscriptions-websockets-autoconfigure:4.9.2") implementation("com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter") diff --git a/sentry-samples/sentry-samples-openfeign/build.gradle.kts b/sentry-samples/sentry-samples-openfeign/build.gradle.kts index 8da1dfe785a..a677c791620 100644 --- a/sentry-samples/sentry-samples-openfeign/build.gradle.kts +++ b/sentry-samples/sentry-samples-openfeign/build.gradle.kts @@ -4,6 +4,8 @@ plugins { alias(libs.plugins.gradle.versions) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.openfeign.Main") } configure { @@ -12,8 +14,8 @@ configure { } dependencies { - implementation(projects.sentry) - implementation(projects.sentryOpenfeign) + implementation("io.sentry:sentry:$sentryVersion") + implementation("io.sentry:sentry-openfeign:$sentryVersion") implementation(libs.feign.core) implementation(libs.feign.gson) } diff --git a/sentry-samples/sentry-samples-servlet/build.gradle.kts b/sentry-samples/sentry-samples-servlet/build.gradle.kts index 01ecef54154..9a08e4b6065 100644 --- a/sentry-samples/sentry-samples-servlet/build.gradle.kts +++ b/sentry-samples/sentry-samples-servlet/build.gradle.kts @@ -9,8 +9,10 @@ java.sourceCompatibility = JavaVersion.VERSION_1_8 java.targetCompatibility = JavaVersion.VERSION_1_8 dependencies { - implementation(projects.sentryServlet) + implementation("io.sentry:sentry-servlet:$sentryVersion") implementation("javax.servlet:javax.servlet-api:4.0.1") } +val sentryVersion = libs.versions.sentry.get() + tasks.withType().configureEach { useJUnitPlatform() } diff --git a/sentry-samples/sentry-samples-spring-7/build.gradle.kts b/sentry-samples/sentry-samples-spring-7/build.gradle.kts index bea3cfec243..35a5c1ab572 100644 --- a/sentry-samples/sentry-samples-spring-7/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-7/build.gradle.kts @@ -12,6 +12,8 @@ plugins { alias(libs.plugins.gretty) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.spring7.Main") } // Ensure WAR is up to date before run task @@ -36,9 +38,9 @@ dependencies { implementation("org.springframework.security:spring-security-config") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpring7) - implementation(projects.sentryLogback) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-7:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") implementation(libs.jackson.databind) implementation(libs.logback.classic) implementation(libs.servlet.jakarta.api) diff --git a/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts index b268e0a8ac6..599996268a1 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-4-log4j2" version = "0.0.1-SNAPSHOT" @@ -39,12 +41,12 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBoot4Starter) - implementation(projects.sentryGraphql22) - implementation(projects.sentryQuartz) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-4-starter:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") - implementation(projects.sentryLog4j2) + implementation("io.sentry:sentry-log4j2:$sentryVersion") implementation("org.springframework.boot:spring-boot-starter-log4j2") modules { module("org.springframework.boot:spring-boot-starter-logging") { @@ -61,9 +63,9 @@ dependencies { // kafka implementation(libs.springboot4.starter.kafka) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } diff --git a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts index d3951974a34..cd201ee453b 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-4" version = "0.0.1-SNAPSHOT" @@ -39,19 +41,19 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBoot4Starter) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql22) - implementation(projects.sentryQuartz) - implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentlessSpring) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-4-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-opentelemetry-agentless-spring:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") // kafka implementation(libs.springboot4.starter.kafka) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } diff --git a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts index f022badf942..ba522d61778 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts @@ -9,6 +9,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-4" version = "0.0.1-SNAPSHOT" @@ -40,23 +42,23 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBoot4Starter) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql22) - implementation(projects.sentryQuartz) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-4-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") implementation(libs.otel) // kafka implementation(libs.springboot4.starter.kafka) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // cache tracing implementation(libs.springboot4.starter.cache) implementation(libs.caffeine) // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } @@ -67,9 +69,8 @@ tasks.register("bootRunWithAgent").configure { mainClass = mainBootRunTask.mainClass classpath = mainBootRunTask.classpath - val versionName = project.properties["versionName"] as String val agentJarPath = - "$rootDir/sentry-opentelemetry/sentry-opentelemetry-agent/build/libs/sentry-opentelemetry-agent-$versionName.jar" + "$rootDir/../sentry-opentelemetry/sentry-opentelemetry-agent/build/libs/sentry-opentelemetry-agent-$sentryVersion.jar" val dsn = System.getenv("SENTRY_DSN") diff --git a/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts index c0b0949f7f0..85034a1a41e 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-4-otlp" version = "0.0.1-SNAPSHOT" @@ -39,19 +41,19 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBoot4Starter) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql22) - implementation(projects.sentryQuartz) - implementation(projects.sentryAsyncProfiler) - implementation(projects.sentryOpentelemetry.sentryOpentelemetryOtlpSpring) + implementation("io.sentry:sentry-spring-boot-4-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") + implementation("io.sentry:sentry-opentelemetry-otlp-spring:$sentryVersion") // cache tracing implementation(libs.springboot4.starter.cache) implementation(libs.caffeine) // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } diff --git a/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts index a4919fcbafa..2c95461358f 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-4-webflux" version = "0.0.1-SNAPSHOT" @@ -15,11 +17,11 @@ version = "0.0.1-SNAPSHOT" dependencies { implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBoot4Starter) - implementation(projects.sentryLogback) - implementation(projects.sentryJdbc) - implementation(projects.sentryGraphql22) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-4-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-jdbc:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") implementation(libs.context.propagation) implementation(libs.springboot4.starter.actuator) implementation(libs.springboot4.starter.graphql) diff --git a/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts index f680328befd..3bcf11392ce 100644 --- a/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-4" version = "0.0.1-SNAPSHOT" @@ -39,11 +41,11 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBoot4Starter) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql22) - implementation(projects.sentryQuartz) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-4-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") // cache tracing implementation(libs.springboot4.starter.cache) @@ -51,13 +53,13 @@ dependencies { // kafka implementation(libs.springboot4.starter.kafka) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // okhttp client instrumentation - implementation(projects.sentryOkhttp) + implementation("io.sentry:sentry-okhttp:$sentryVersion") implementation(libs.okhttp) // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-log4j2/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta-log4j2/build.gradle.kts index b195f560011..fe3473c402f 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-log4j2/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-log4j2/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-jakarta-log4j2" version = "0.0.1-SNAPSHOT" @@ -41,8 +43,8 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarterJakarta) - implementation(projects.sentryLog4j2) + implementation("io.sentry:sentry-spring-boot-starter-jakarta:$sentryVersion") + implementation("io.sentry:sentry-log4j2:$sentryVersion") implementation("org.springframework.boot:spring-boot-starter-log4j2") modules { module("org.springframework.boot:spring-boot-starter-logging") { @@ -52,10 +54,10 @@ dependencies { ) } } - implementation(projects.sentryGraphql22) - implementation(projects.sentryQuartz) - implementation(projects.sentryAsyncProfiler) - implementation(projects.sentryOpenfeature) + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") + implementation("io.sentry:sentry-openfeature:$sentryVersion") // cache tracing implementation(libs.springboot3.starter.cache) @@ -63,12 +65,12 @@ dependencies { // kafka implementation(libs.spring.kafka3) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // OpenFeature SDK implementation(libs.openfeature) // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts index bbc6bebdcd9..2484821cea7 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-jakarta" version = "0.0.1-SNAPSHOT" @@ -42,22 +44,22 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarterJakarta) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql22) - implementation(projects.sentryQuartz) - implementation(projects.sentryAsyncProfiler) - implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentlessSpring) + implementation("io.sentry:sentry-spring-boot-starter-jakarta:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") + implementation("io.sentry:sentry-opentelemetry-agentless-spring:$sentryVersion") // kafka implementation(libs.spring.kafka3) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // cache tracing implementation(libs.springboot3.starter.cache) implementation(libs.caffeine) // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts index 1e41692fb2e..3084e08aa4e 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts @@ -9,6 +9,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-jakarta" version = "0.0.1-SNAPSHOT" @@ -42,23 +44,23 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarterJakarta) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql22) - implementation(projects.sentryQuartz) + implementation("io.sentry:sentry-spring-boot-starter-jakarta:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") implementation(libs.otel) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-async-profiler:$sentryVersion") // kafka implementation(libs.spring.kafka3) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // cache tracing implementation(libs.springboot3.starter.cache) implementation(libs.caffeine) // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } @@ -69,9 +71,8 @@ tasks.register("bootRunWithAgent").configure { mainClass = mainBootRunTask.mainClass classpath = mainBootRunTask.classpath - val versionName = project.properties["versionName"] as String val agentJarPath = - "$rootDir/sentry-opentelemetry/sentry-opentelemetry-agent/build/libs/sentry-opentelemetry-agent-$versionName.jar" + "$rootDir/../sentry-opentelemetry/sentry-opentelemetry-agent/build/libs/sentry-opentelemetry-agent-$sentryVersion.jar" val dsn = System.getenv("SENTRY_DSN") diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts index d8ccb27dbf3..0cc259118f2 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-jakarta" version = "0.0.1-SNAPSHOT" @@ -41,12 +43,12 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarterJakarta) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql22) - implementation(projects.sentryQuartz) - implementation(projects.sentryAsyncProfiler) - implementation(projects.sentryOpenfeature) + implementation("io.sentry:sentry-spring-boot-starter-jakarta:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") + implementation("io.sentry:sentry-openfeature:$sentryVersion") // cache tracing implementation(libs.springboot3.starter.cache) @@ -54,16 +56,16 @@ dependencies { // kafka implementation(libs.spring.kafka3) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // OpenFeature SDK implementation(libs.openfeature) // okhttp client instrumentation - implementation(projects.sentryOkhttp) + implementation("io.sentry:sentry-okhttp:$sentryVersion") implementation(libs.okhttp) // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } diff --git a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts index 775bf305da3..b25b369f175 100644 --- a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts @@ -10,6 +10,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + // Spring scans this app's own bytecode with its repackaged ASM at startup, and the oldest version // the Spring Boot 2.x matrix covers (2.4.13, Spring 5.3.13) fails on class files as new as the // toolchain's: "Unsupported class file major version 65". Only the app is scanned, so its test @@ -48,18 +50,18 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarter) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql) - implementation(projects.sentryQuartz) - implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentlessSpring) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-opentelemetry-agentless-spring:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") implementation(libs.spring.kafka2) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } diff --git a/sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts index eb4679099d4..a8b83ab6b13 100644 --- a/sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts @@ -10,6 +10,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + // Spring scans this app's own bytecode with its repackaged ASM at startup, and the oldest version // the Spring Boot 2.x matrix covers (2.4.13, Spring 5.3.13) fails on class files as new as the // toolchain's: "Unsupported class file major version 65". Only the app is scanned, so its test @@ -47,18 +49,18 @@ dependencies { implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarter) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql) - implementation(projects.sentryQuartz) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") implementation(libs.otel) implementation(libs.spring.kafka2) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } @@ -90,9 +92,8 @@ tasks.register("bootRunWithAgent").configure { mainClass.set("io.sentry.samples.spring.boot.SentryDemoApplication") classpath = sourceSets["main"].runtimeClasspath - val versionName = project.properties["versionName"] as String val agentJarPath = - "$rootDir/sentry-opentelemetry/sentry-opentelemetry-agent/build/libs/sentry-opentelemetry-agent-$versionName.jar" + "$rootDir/../sentry-opentelemetry/sentry-opentelemetry-agent/build/libs/sentry-opentelemetry-agent-$sentryVersion.jar" val dsn = System.getenv("SENTRY_DSN") diff --git a/sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts index 137c5e09407..fc57dbe633b 100644 --- a/sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + group = "io.sentry.sample.spring-boot-webflux-jakarta" version = "0.0.1-SNAPSHOT" @@ -24,11 +26,11 @@ extra["kotlin-coroutines.version"] = "1.9.0" dependencies { implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarterJakarta) - implementation(projects.sentryLogback) - implementation(projects.sentryJdbc) - implementation(projects.sentryGraphql22) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-starter-jakarta:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-jdbc:$sentryVersion") + implementation("io.sentry:sentry-graphql-22:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") implementation(libs.context.propagation) implementation(libs.springboot3.starter.actuator) implementation(libs.springboot3.starter.graphql) diff --git a/sentry-samples/sentry-samples-spring-boot-webflux/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-webflux/build.gradle.kts index 0959522ad94..3b1bc0c7422 100644 --- a/sentry-samples/sentry-samples-spring-boot-webflux/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-webflux/build.gradle.kts @@ -10,6 +10,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + // Spring scans this app's own bytecode with its repackaged ASM at startup, and the oldest version // the Spring Boot 2.x matrix covers (2.4.13, Spring 5.3.13) fails on class files as new as the // toolchain's: "Unsupported class file major version 65". Only the app is scanned, so its test @@ -33,10 +35,10 @@ dependencies { implementation(libs.springboot.starter.webflux) implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarter) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") } val runtimeClasspath = configurations.named("runtimeClasspath") diff --git a/sentry-samples/sentry-samples-spring-boot/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot/build.gradle.kts index 1dfa785bb6e..825de979e7a 100644 --- a/sentry-samples/sentry-samples-spring-boot/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot/build.gradle.kts @@ -10,6 +10,8 @@ plugins { alias(libs.plugins.kotlin.spring) } +val sentryVersion = libs.versions.sentry.get() + // Spring scans this app's own bytecode with its repackaged ASM at startup, and the oldest version // the Spring Boot 2.x matrix covers (2.4.13, Spring 5.3.13) fails on class files as new as the // toolchain's: "Unsupported class file major version 65". Only the app is scanned, so its test @@ -48,22 +50,22 @@ dependencies { implementation(libs.caffeine) implementation(libs.spring.kafka2) - implementation(projects.sentryKafka) + implementation("io.sentry:sentry-kafka:$sentryVersion") implementation("org.aspectj:aspectjweaver") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8", getKotlinPluginVersion())) - implementation(projects.sentrySpringBootStarter) - implementation(projects.sentryLogback) - implementation(projects.sentryGraphql) - implementation(projects.sentryQuartz) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-boot-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-graphql:$sentryVersion") + implementation("io.sentry:sentry-quartz:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") // okhttp client instrumentation - implementation(projects.sentryOkhttp) + implementation("io.sentry:sentry-okhttp:$sentryVersion") implementation(libs.okhttp) // database query tracing - implementation(projects.sentryJdbc) + implementation("io.sentry:sentry-jdbc:$sentryVersion") runtimeOnly(libs.hsqldb) } diff --git a/sentry-samples/sentry-samples-spring-jakarta/build.gradle.kts b/sentry-samples/sentry-samples-spring-jakarta/build.gradle.kts index 683031cfb62..6702f204d2e 100644 --- a/sentry-samples/sentry-samples-spring-jakarta/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-jakarta/build.gradle.kts @@ -9,6 +9,8 @@ plugins { alias(libs.plugins.gretty) } +val sentryVersion = libs.versions.sentry.get() + application { mainClass.set("io.sentry.samples.spring.jakarta.Main") } // Ensure WAR is up to date before run task @@ -34,9 +36,9 @@ dependencies { implementation("org.springframework.security:spring-security-config") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8")) - implementation(projects.sentrySpringJakarta) - implementation(projects.sentryLogback) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring-jakarta:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") implementation(libs.jackson.databind) implementation(libs.logback.classic) implementation(libs.servlet.jakarta.api) diff --git a/sentry-samples/sentry-samples-spring/build.gradle.kts b/sentry-samples/sentry-samples-spring/build.gradle.kts index ba97f3e7045..aa10690b298 100644 --- a/sentry-samples/sentry-samples-spring/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring/build.gradle.kts @@ -9,6 +9,8 @@ plugins { alias(libs.plugins.gretty) } +val sentryVersion = libs.versions.sentry.get() + // Spring scans this app's own bytecode with its repackaged ASM at startup, and the oldest version // the Spring Boot 2.x matrix covers (2.4.13, Spring 5.3.13) fails on class files as new as the // toolchain's: "Unsupported class file major version 65". Only the app is scanned, so its test @@ -45,9 +47,9 @@ dependencies { implementation("org.springframework.security:spring-security-config") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation(kotlin("stdlib-jdk8")) - implementation(projects.sentrySpring) - implementation(projects.sentryLogback) - implementation(projects.sentryAsyncProfiler) + implementation("io.sentry:sentry-spring:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") + implementation("io.sentry:sentry-async-profiler:$sentryVersion") implementation(libs.jackson.databind) implementation(libs.logback.classic) implementation(libs.servlet.api) diff --git a/sentry-samples/settings.gradle.kts b/sentry-samples/settings.gradle.kts new file mode 100644 index 00000000000..91b8060ec4b --- /dev/null +++ b/sentry-samples/settings.gradle.kts @@ -0,0 +1,84 @@ +// A standalone build that includes the SDK build, so the samples depend on the SDK through the same +// io.sentry:* coordinates an app would, and Gradle substitutes the SDK's projects for them. +// The SDK build doesn't include this one back, so the samples' plugins and versions stay out of +// the SDK build. Run it with `./gradlew -p sentry-samples `. +// sentry-samples-android is a separate build of its own. + +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("com.gradle.develocity") version "4.5.0" + id("com.gradle.common-custom-user-data-gradle-plugin") version "2.8.0" +} + +develocity { + buildScan { + termsOfUseUrl.set("https://gradle.com/help/legal-terms-of-use") + termsOfUseAgree.set("yes") + } +} + +// Gradle reads gradle.properties only for the build it belongs to, so read the SDK version from the +// SDK build's file. +val sentryVersion: String = + providers + .fileContents(layout.settingsDirectory.file("../gradle.properties")) + .asText + .map { java.util.Properties().apply { load(it.reader()) }.getProperty("versionName") } + .get() + +dependencyResolutionManagement { + repositories { + mavenCentral() + mavenLocal() + } + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + version("sentry", sentryVersion) + } + } +} + +rootProject.name = "sentry-samples" + +includeBuild("..") + +// For the io.sentry.spotless and io.sentry.jdk-target convention plugins. +includeBuild("../build-logic") + +include( + "sentry-samples-console", + "sentry-samples-console-opentelemetry-noagent", + "sentry-samples-console-otlp", + "sentry-samples-jul", + "sentry-samples-ktor-client", + "sentry-samples-log4j2", + "sentry-samples-logback", + "sentry-samples-netflix-dgs", + "sentry-samples-openfeign", + "sentry-samples-servlet", + "sentry-samples-spring", + "sentry-samples-spring-7", + "sentry-samples-spring-boot", + "sentry-samples-spring-boot-4", + "sentry-samples-spring-boot-4-log4j2", + "sentry-samples-spring-boot-4-opentelemetry", + "sentry-samples-spring-boot-4-opentelemetry-noagent", + "sentry-samples-spring-boot-4-otlp", + "sentry-samples-spring-boot-4-webflux", + "sentry-samples-spring-boot-jakarta", + "sentry-samples-spring-boot-jakarta-log4j2", + "sentry-samples-spring-boot-jakarta-opentelemetry", + "sentry-samples-spring-boot-jakarta-opentelemetry-noagent", + "sentry-samples-spring-boot-opentelemetry", + "sentry-samples-spring-boot-opentelemetry-noagent", + "sentry-samples-spring-boot-webflux", + "sentry-samples-spring-boot-webflux-jakarta", + "sentry-samples-spring-jakarta", +) diff --git a/settings.gradle.kts b/settings.gradle.kts index aae18edb922..852765c03d8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -102,33 +102,5 @@ include( "sentry-launchdarkly-android", "sentry-reactor", "sentry-async-profiler", - "sentry-ktor-client", - "sentry-samples:sentry-samples-console", - "sentry-samples:sentry-samples-console-otlp", - "sentry-samples:sentry-samples-console-opentelemetry-noagent", - "sentry-samples:sentry-samples-jul", - "sentry-samples:sentry-samples-ktor-client", - "sentry-samples:sentry-samples-log4j2", - "sentry-samples:sentry-samples-logback", - "sentry-samples:sentry-samples-servlet", - "sentry-samples:sentry-samples-spring", - "sentry-samples:sentry-samples-spring-jakarta", - "sentry-samples:sentry-samples-spring-7", - "sentry-samples:sentry-samples-spring-boot", - "sentry-samples:sentry-samples-spring-boot-opentelemetry", - "sentry-samples:sentry-samples-spring-boot-opentelemetry-noagent", - "sentry-samples:sentry-samples-spring-boot-jakarta", - "sentry-samples:sentry-samples-spring-boot-jakarta-log4j2", - "sentry-samples:sentry-samples-spring-boot-jakarta-opentelemetry", - "sentry-samples:sentry-samples-spring-boot-jakarta-opentelemetry-noagent", - "sentry-samples:sentry-samples-spring-boot-webflux", - "sentry-samples:sentry-samples-spring-boot-webflux-jakarta", - "sentry-samples:sentry-samples-spring-boot-4", - "sentry-samples:sentry-samples-spring-boot-4-log4j2", - "sentry-samples:sentry-samples-spring-boot-4-opentelemetry", - "sentry-samples:sentry-samples-spring-boot-4-opentelemetry-noagent", - "sentry-samples:sentry-samples-spring-boot-4-otlp", - "sentry-samples:sentry-samples-spring-boot-4-webflux", - "sentry-samples:sentry-samples-netflix-dgs", - "sentry-samples:sentry-samples-openfeign" + "sentry-ktor-client" ) From 3e201ea6dc76f6db97bf811436d3b0a299614069 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 5 Nov 2026 18:20:03 +0100 Subject: [PATCH 2/7] build(samples): Link the JVM samples' Gradle files to the SDK build's gradle.properties, gradlew, gradle/wrapper and gradle/gradle-daemon-jvm.properties are now symlinks to the SDK build's files, as in the Android sample and integration test builds. The copied gradle.properties had drifted from the root one (-Xmx6g and CrashOnOutOfMemoryError), and the build had no wrapper or daemon JDK pin. The settings read the SDK version from the shared versionName property, use the root build's Develocity plugin version, and include each sample on its own line, matching the other separate builds. Co-Authored-By: Claude Opus 5.5 --- sentry-samples/gradle.properties | 14 +--- .../gradle/gradle-daemon-jvm.properties | 1 + sentry-samples/gradle/wrapper | 1 + sentry-samples/gradlew | 1 + sentry-samples/settings.gradle.kts | 72 ++++++++----------- 5 files changed, 35 insertions(+), 54 deletions(-) mode change 100644 => 120000 sentry-samples/gradle.properties create mode 120000 sentry-samples/gradle/gradle-daemon-jvm.properties create mode 120000 sentry-samples/gradle/wrapper create mode 120000 sentry-samples/gradlew diff --git a/sentry-samples/gradle.properties b/sentry-samples/gradle.properties deleted file mode 100644 index d4b4b304bdc..00000000000 --- a/sentry-samples/gradle.properties +++ /dev/null @@ -1,13 +0,0 @@ -# Gradle properties are per build, so this repeats what the samples need from the SDK build's -# gradle.properties. settings.gradle.kts reads the SDK version from that file. - -org.gradle.jvmargs=-Xmx6g -XX:MaxMetaspaceSize=2g -XX:+CrashOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -org.gradle.caching=true -org.gradle.parallel=true -org.gradle.configureondemand=true -org.gradle.configuration-cache=true -org.gradle.configuration-cache.parallel=true - -kotlin.stdlib.default.dependency=false - -systemProp.org.gradle.internal.http.socketTimeout=120000 diff --git a/sentry-samples/gradle.properties b/sentry-samples/gradle.properties new file mode 120000 index 00000000000..7677fb73be8 --- /dev/null +++ b/sentry-samples/gradle.properties @@ -0,0 +1 @@ +../gradle.properties \ No newline at end of file diff --git a/sentry-samples/gradle/gradle-daemon-jvm.properties b/sentry-samples/gradle/gradle-daemon-jvm.properties new file mode 120000 index 00000000000..284e270637d --- /dev/null +++ b/sentry-samples/gradle/gradle-daemon-jvm.properties @@ -0,0 +1 @@ +../../gradle/gradle-daemon-jvm.properties \ No newline at end of file diff --git a/sentry-samples/gradle/wrapper b/sentry-samples/gradle/wrapper new file mode 120000 index 00000000000..3232fe4e272 --- /dev/null +++ b/sentry-samples/gradle/wrapper @@ -0,0 +1 @@ +../../gradle/wrapper \ No newline at end of file diff --git a/sentry-samples/gradlew b/sentry-samples/gradlew new file mode 120000 index 00000000000..502f5a2d3ec --- /dev/null +++ b/sentry-samples/gradlew @@ -0,0 +1 @@ +../gradlew \ No newline at end of file diff --git a/sentry-samples/settings.gradle.kts b/sentry-samples/settings.gradle.kts index 91b8060ec4b..97ee6f59fb4 100644 --- a/sentry-samples/settings.gradle.kts +++ b/sentry-samples/settings.gradle.kts @@ -12,7 +12,7 @@ pluginManagement { } plugins { - id("com.gradle.develocity") version "4.5.0" + id("com.gradle.develocity") version "4.6.1" id("com.gradle.common-custom-user-data-gradle-plugin") version "2.8.0" } @@ -23,15 +23,6 @@ develocity { } } -// Gradle reads gradle.properties only for the build it belongs to, so read the SDK version from the -// SDK build's file. -val sentryVersion: String = - providers - .fileContents(layout.settingsDirectory.file("../gradle.properties")) - .asText - .map { java.util.Properties().apply { load(it.reader()) }.getProperty("versionName") } - .get() - dependencyResolutionManagement { repositories { mavenCentral() @@ -40,7 +31,8 @@ dependencyResolutionManagement { versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) - version("sentry", sentryVersion) + // gradle.properties links to the SDK build's, so versionName is the SDK version. + version("sentry", providers.gradleProperty("versionName").get()) } } } @@ -52,33 +44,31 @@ includeBuild("..") // For the io.sentry.spotless and io.sentry.jdk-target convention plugins. includeBuild("../build-logic") -include( - "sentry-samples-console", - "sentry-samples-console-opentelemetry-noagent", - "sentry-samples-console-otlp", - "sentry-samples-jul", - "sentry-samples-ktor-client", - "sentry-samples-log4j2", - "sentry-samples-logback", - "sentry-samples-netflix-dgs", - "sentry-samples-openfeign", - "sentry-samples-servlet", - "sentry-samples-spring", - "sentry-samples-spring-7", - "sentry-samples-spring-boot", - "sentry-samples-spring-boot-4", - "sentry-samples-spring-boot-4-log4j2", - "sentry-samples-spring-boot-4-opentelemetry", - "sentry-samples-spring-boot-4-opentelemetry-noagent", - "sentry-samples-spring-boot-4-otlp", - "sentry-samples-spring-boot-4-webflux", - "sentry-samples-spring-boot-jakarta", - "sentry-samples-spring-boot-jakarta-log4j2", - "sentry-samples-spring-boot-jakarta-opentelemetry", - "sentry-samples-spring-boot-jakarta-opentelemetry-noagent", - "sentry-samples-spring-boot-opentelemetry", - "sentry-samples-spring-boot-opentelemetry-noagent", - "sentry-samples-spring-boot-webflux", - "sentry-samples-spring-boot-webflux-jakarta", - "sentry-samples-spring-jakarta", -) +include("sentry-samples-console") +include("sentry-samples-console-opentelemetry-noagent") +include("sentry-samples-console-otlp") +include("sentry-samples-jul") +include("sentry-samples-ktor-client") +include("sentry-samples-log4j2") +include("sentry-samples-logback") +include("sentry-samples-netflix-dgs") +include("sentry-samples-openfeign") +include("sentry-samples-servlet") +include("sentry-samples-spring") +include("sentry-samples-spring-7") +include("sentry-samples-spring-boot") +include("sentry-samples-spring-boot-4") +include("sentry-samples-spring-boot-4-log4j2") +include("sentry-samples-spring-boot-4-opentelemetry") +include("sentry-samples-spring-boot-4-opentelemetry-noagent") +include("sentry-samples-spring-boot-4-otlp") +include("sentry-samples-spring-boot-4-webflux") +include("sentry-samples-spring-boot-jakarta") +include("sentry-samples-spring-boot-jakarta-log4j2") +include("sentry-samples-spring-boot-jakarta-opentelemetry") +include("sentry-samples-spring-boot-jakarta-opentelemetry-noagent") +include("sentry-samples-spring-boot-opentelemetry") +include("sentry-samples-spring-boot-opentelemetry-noagent") +include("sentry-samples-spring-boot-webflux") +include("sentry-samples-spring-boot-webflux-jakarta") +include("sentry-samples-spring-jakarta") From 339d8d76dd1e0375711000fdbb8987320b3f643f Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 5 Nov 2026 18:20:03 +0100 Subject: [PATCH 3/7] build(samples): Apply the convention plugins in each JVM sample Each sample applies io.sentry.spotless and io.sentry.jdk-target in its own plugins block, as the modules of the other separate builds do, instead of the root script applying them to every subproject. Co-Authored-By: Claude Opus 5.5 --- .cursor/rules/new_module.mdc | 5 +++-- sentry-samples/build.gradle.kts | 5 ----- .../build.gradle.kts | 2 ++ sentry-samples/sentry-samples-console-otlp/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-console/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-jul/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-ktor-client/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-log4j2/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-logback/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-openfeign/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-servlet/build.gradle.kts | 6 +++++- sentry-samples/sentry-samples-spring-7/build.gradle.kts | 2 ++ .../sentry-samples-spring-boot-4-log4j2/build.gradle.kts | 2 ++ .../build.gradle.kts | 2 ++ .../build.gradle.kts | 2 ++ .../sentry-samples-spring-boot-4-otlp/build.gradle.kts | 2 ++ .../sentry-samples-spring-boot-4-webflux/build.gradle.kts | 2 ++ .../sentry-samples-spring-boot-4/build.gradle.kts | 2 ++ .../build.gradle.kts | 2 ++ .../build.gradle.kts | 2 ++ .../build.gradle.kts | 2 ++ .../sentry-samples-spring-boot-jakarta/build.gradle.kts | 2 ++ .../build.gradle.kts | 2 ++ .../build.gradle.kts | 2 ++ .../build.gradle.kts | 2 ++ .../sentry-samples-spring-boot-webflux/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-spring-boot/build.gradle.kts | 2 ++ .../sentry-samples-spring-jakarta/build.gradle.kts | 2 ++ sentry-samples/sentry-samples-spring/build.gradle.kts | 2 ++ 30 files changed, 62 insertions(+), 8 deletions(-) diff --git a/.cursor/rules/new_module.mdc b/.cursor/rules/new_module.mdc index a190240f7fb..77f8e7367fa 100644 --- a/.cursor/rules/new_module.mdc +++ b/.cursor/rules/new_module.mdc @@ -31,8 +31,9 @@ the release that first ships it. All of the following have to be merged **before 2. Add the module to the include list in `settings.gradle.kts` -If adding a sample, add it to the include list in `sentry-samples/settings.gradle.kts` instead. The -samples are a separate Gradle build that includes the SDK build, so a sample depends on +If adding a sample, add an `include("…")` line for it to `sentry-samples/settings.gradle.kts` +instead, and apply `id("io.sentry.spotless")` and `id("io.sentry.jdk-target")` in its `plugins` +block. The samples are a separate Gradle build that includes the SDK build, so a sample depends on `"io.sentry:sentry-{module-name}:$sentryVersion"` (with `val sentryVersion = libs.versions.sentry.get()`), and Gradle substitutes the SDK's project for it. diff --git a/sentry-samples/build.gradle.kts b/sentry-samples/build.gradle.kts index 378180567e1..c55b9cb7973 100644 --- a/sentry-samples/build.gradle.kts +++ b/sentry-samples/build.gradle.kts @@ -8,8 +8,3 @@ plugins { id("io.sentry.spotless") apply false id("io.sentry.jdk-target") apply false } - -subprojects { - apply(plugin = "io.sentry.spotless") - apply(plugin = "io.sentry.jdk-target") -} diff --git a/sentry-samples/sentry-samples-console-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-console-opentelemetry-noagent/build.gradle.kts index b72ae75ca6a..f99e78dd22e 100644 --- a/sentry-samples/sentry-samples-console-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-console-opentelemetry-noagent/build.gradle.kts @@ -3,6 +3,8 @@ plugins { application alias(libs.plugins.gradle.versions) alias(libs.plugins.shadow) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-console-otlp/build.gradle.kts b/sentry-samples/sentry-samples-console-otlp/build.gradle.kts index 060aae8979c..dd0e4a149b2 100644 --- a/sentry-samples/sentry-samples-console-otlp/build.gradle.kts +++ b/sentry-samples/sentry-samples-console-otlp/build.gradle.kts @@ -3,6 +3,8 @@ plugins { application alias(libs.plugins.gradle.versions) alias(libs.plugins.shadow) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-console/build.gradle.kts b/sentry-samples/sentry-samples-console/build.gradle.kts index a1e96c725b3..d70b509a72f 100644 --- a/sentry-samples/sentry-samples-console/build.gradle.kts +++ b/sentry-samples/sentry-samples-console/build.gradle.kts @@ -3,6 +3,8 @@ plugins { application alias(libs.plugins.gradle.versions) alias(libs.plugins.shadow) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-jul/build.gradle.kts b/sentry-samples/sentry-samples-jul/build.gradle.kts index 78495a72203..5129c48b62a 100644 --- a/sentry-samples/sentry-samples-jul/build.gradle.kts +++ b/sentry-samples/sentry-samples-jul/build.gradle.kts @@ -3,6 +3,8 @@ plugins { application alias(libs.plugins.gradle.versions) alias(libs.plugins.shadow) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-ktor-client/build.gradle.kts b/sentry-samples/sentry-samples-ktor-client/build.gradle.kts index 9b89d6cd46a..6f31bfe9e48 100644 --- a/sentry-samples/sentry-samples-ktor-client/build.gradle.kts +++ b/sentry-samples/sentry-samples-ktor-client/build.gradle.kts @@ -2,6 +2,8 @@ plugins { alias(libs.plugins.kotlin.jvm) application alias(libs.plugins.gradle.versions) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-log4j2/build.gradle.kts b/sentry-samples/sentry-samples-log4j2/build.gradle.kts index 3fa6dfcf986..ea8373c939f 100644 --- a/sentry-samples/sentry-samples-log4j2/build.gradle.kts +++ b/sentry-samples/sentry-samples-log4j2/build.gradle.kts @@ -3,6 +3,8 @@ plugins { application alias(libs.plugins.gradle.versions) alias(libs.plugins.shadow) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-logback/build.gradle.kts b/sentry-samples/sentry-samples-logback/build.gradle.kts index d192ba37aaa..c3e10054745 100644 --- a/sentry-samples/sentry-samples-logback/build.gradle.kts +++ b/sentry-samples/sentry-samples-logback/build.gradle.kts @@ -3,6 +3,8 @@ plugins { application alias(libs.plugins.gradle.versions) alias(libs.plugins.shadow) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts b/sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts index 7ffbb6d234c..097b7dbcccb 100644 --- a/sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts +++ b/sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.shadow) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-openfeign/build.gradle.kts b/sentry-samples/sentry-samples-openfeign/build.gradle.kts index a677c791620..de871eb4115 100644 --- a/sentry-samples/sentry-samples-openfeign/build.gradle.kts +++ b/sentry-samples/sentry-samples-openfeign/build.gradle.kts @@ -2,6 +2,8 @@ plugins { java application alias(libs.plugins.gradle.versions) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-servlet/build.gradle.kts b/sentry-samples/sentry-samples-servlet/build.gradle.kts index 9a08e4b6065..760fbe87f20 100644 --- a/sentry-samples/sentry-samples-servlet/build.gradle.kts +++ b/sentry-samples/sentry-samples-servlet/build.gradle.kts @@ -1,4 +1,8 @@ -plugins { war } +plugins { + war + id("io.sentry.spotless") + id("io.sentry.jdk-target") +} group = "io.sentry.sample.servlet" diff --git a/sentry-samples/sentry-samples-spring-7/build.gradle.kts b/sentry-samples/sentry-samples-spring-7/build.gradle.kts index 35a5c1ab572..e16b85724cc 100644 --- a/sentry-samples/sentry-samples-spring-7/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-7/build.gradle.kts @@ -10,6 +10,8 @@ plugins { alias(libs.plugins.kotlin.spring) id("war") alias(libs.plugins.gretty) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts index 599996268a1..6564d2899ca 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-log4j2/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts index cd201ee453b..57a81dc707b 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts index ba522d61778..f20af05ccf1 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-opentelemetry/build.gradle.kts @@ -7,6 +7,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts index 85034a1a41e..016f1c70b30 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-otlp/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts index 2c95461358f..23140a7b21d 100644 --- a/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4-webflux/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts index 3bcf11392ce..77393c9b36c 100644 --- a/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-4/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-log4j2/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta-log4j2/build.gradle.kts index fe3473c402f..0e8e2069b06 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-log4j2/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-log4j2/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts index 2484821cea7..12b86dcc6b5 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts index 3084e08aa4e..0ba3ebf83c4 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts @@ -7,6 +7,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts index 0cc259118f2..fedd8086ded 100644 --- a/sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts index b25b369f175..97ba9a0ac48 100644 --- a/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.shadow) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts index a8b83ab6b13..bd2e68e334b 100644 --- a/sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.shadow) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts index fc57dbe633b..50c1b85a197 100644 --- a/sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts @@ -6,6 +6,8 @@ plugins { alias(libs.plugins.spring.dependency.management) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot-webflux/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot-webflux/build.gradle.kts index 3b1bc0c7422..f066a9dc9e0 100644 --- a/sentry-samples/sentry-samples-spring-boot-webflux/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot-webflux/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.shadow) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-boot/build.gradle.kts b/sentry-samples/sentry-samples-spring-boot/build.gradle.kts index 825de979e7a..234b2bcc869 100644 --- a/sentry-samples/sentry-samples-spring-boot/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-boot/build.gradle.kts @@ -8,6 +8,8 @@ plugins { alias(libs.plugins.shadow) alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.spring) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring-jakarta/build.gradle.kts b/sentry-samples/sentry-samples-spring-jakarta/build.gradle.kts index 6702f204d2e..4c9771ea576 100644 --- a/sentry-samples/sentry-samples-spring-jakarta/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring-jakarta/build.gradle.kts @@ -7,6 +7,8 @@ plugins { alias(libs.plugins.kotlin.spring) id("war") alias(libs.plugins.gretty) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() diff --git a/sentry-samples/sentry-samples-spring/build.gradle.kts b/sentry-samples/sentry-samples-spring/build.gradle.kts index aa10690b298..ffb672b8648 100644 --- a/sentry-samples/sentry-samples-spring/build.gradle.kts +++ b/sentry-samples/sentry-samples-spring/build.gradle.kts @@ -7,6 +7,8 @@ plugins { alias(libs.plugins.kotlin.spring) id("war") alias(libs.plugins.gretty) + id("io.sentry.spotless") + id("io.sentry.jdk-target") } val sentryVersion = libs.versions.sentry.get() From 881dfbaed00122a5fae64514a7b5c1410111e075 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 5 Nov 2026 18:20:03 +0100 Subject: [PATCH 4/7] ci(samples): Check the JVM samples in the Samples workflow The JVM samples' check runs as its own job in the Samples workflow, like the other separate builds, instead of through checkSamples in make preMerge, so it no longer lengthens the required Build job. Dependabot scans their build too. Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 1 + .github/workflows/samples.yml | 2 ++ Makefile | 8 ++------ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8e712646a1e..d1593330dd3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,6 +12,7 @@ updates: - "/" - "/sentry-samples/sentry-samples-android" - "/sentry-android-integration-tests" + - "/sentry-samples" registries: - gradle-plugin-portal schedule: diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index c0376a85328..08ba64660e4 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -24,6 +24,8 @@ jobs: path: sentry-samples/sentry-samples-android - name: sentry-android-integration-tests path: sentry-android-integration-tests + - name: sentry-samples + path: sentry-samples steps: - name: Checkout Repo diff --git a/Makefile b/Makefile index fe1f3c5c9f0..562eec68140 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -.PHONY: all clean compile javadocs dryRelease update format checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical check checkSamples preMerge publish +.PHONY: all clean compile javadocs dryRelease update format checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical check preMerge publish all: stop clean javadocs compile assembleUiTests: assembleUiTestRelease -preMerge: check checkSamples +preMerge: check publish: clean dryRelease # deep clean @@ -58,7 +58,3 @@ runUiTestCritical: # Run tests and lint check: ./gradlew check - -# The samples are separate builds, so the root `check` doesn't reach them -checkSamples: - ./gradlew -p sentry-samples check From 683153caf04510e311cf8e97d1594bc099bfccb4 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 5 Nov 2026 18:20:03 +0100 Subject: [PATCH 5/7] build: Drop the root's Spring dependency-management declaration With the JVM samples in their own build, no project in the SDK build applies io.spring.dependency-management. Co-Authored-By: Claude Opus 5.5 --- build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index c084280e7d1..07132af26de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,7 +23,6 @@ plugins { alias(libs.plugins.kotlin.compose) apply false alias(libs.plugins.errorprone) apply false alias(libs.plugins.gradle.versions) apply false - alias(libs.plugins.spring.dependency.management) apply false id("io.sentry.javadoc.aggregate") alias(libs.plugins.android.application) apply false } From c936639a905151ba83eca518a96d2da9d81d3b09 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 5 Nov 2026 18:31:37 +0100 Subject: [PATCH 6/7] build(samples): Drop the comment on the JVM samples' root plugins Co-Authored-By: Claude Opus 5.5 --- sentry-samples/build.gradle.kts | 2 -- 1 file changed, 2 deletions(-) diff --git a/sentry-samples/build.gradle.kts b/sentry-samples/build.gradle.kts index c55b9cb7973..3a344b8e8d2 100644 --- a/sentry-samples/build.gradle.kts +++ b/sentry-samples/build.gradle.kts @@ -1,5 +1,3 @@ -// Loads the shared plugins once for every sample, so they all share one classpath. The Spring Boot -// plugin is applied in each sample instead, because the samples use different versions of it. plugins { alias(libs.plugins.kotlin.jvm) apply false alias(libs.plugins.kotlin.spring) apply false From 6cb9996829ccc82be785092b1ba52c0d586719bf Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 5 Nov 2026 18:33:03 +0100 Subject: [PATCH 7/7] build(samples): Drop the header comment from the JVM samples' settings Co-Authored-By: Claude Opus 5.5 --- sentry-samples/settings.gradle.kts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sentry-samples/settings.gradle.kts b/sentry-samples/settings.gradle.kts index 97ee6f59fb4..ad2fe3e3db6 100644 --- a/sentry-samples/settings.gradle.kts +++ b/sentry-samples/settings.gradle.kts @@ -1,9 +1,3 @@ -// A standalone build that includes the SDK build, so the samples depend on the SDK through the same -// io.sentry:* coordinates an app would, and Gradle substitutes the SDK's projects for them. -// The SDK build doesn't include this one back, so the samples' plugins and versions stay out of -// the SDK build. Run it with `./gradlew -p sentry-samples `. -// sentry-samples-android is a separate build of its own. - pluginManagement { repositories { mavenCentral()