From 8324d47750a794aab66b31c8341443f050054e25 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 27 Oct 2026 13:12:07 +0100 Subject: [PATCH] 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 +--- .github/workflows/format-code.yml | 1 + AGENTS.md | 5 +- Makefile | 9 +- 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 +------ 37 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/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index f92f275e98f..8fade63ea96 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -26,6 +26,7 @@ jobs: - name: Format with spotlessApply run: | ./gradlew spotlessApply + ./gradlew -p sentry-samples spotlessApply ./gradlew -p sentry-samples/sentry-samples-android spotlessApply ./gradlew -p sentry-android-integration-tests spotlessApply diff --git a/AGENTS.md b/AGENTS.md index 46922bc06eb..4b57a64552d 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 1019344a3d5..467e3c3be2f 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -.PHONY: all clean compile javadocs dryRelease update checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical check checkSampleAndroid checkIntegrationTests preMerge publish +.PHONY: all clean compile javadocs dryRelease update checkFormat api assembleUiTestRelease assembleUiTestCriticalRelease runUiTestCritical check checkSamples checkSampleAndroid checkIntegrationTests preMerge publish all: stop clean javadocs compile assembleUiTests: assembleUiTestRelease -preMerge: check checkSampleAndroid checkIntegrationTests +preMerge: check checkSamples checkSampleAndroid checkIntegrationTests publish: clean dryRelease # deep clean @@ -28,6 +28,7 @@ update: # 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 @@ -51,6 +52,10 @@ runUiTestCritical: check: ./gradlew check +# The samples are separate builds, so the root `check` doesn't reach them +checkSamples: + ./gradlew -p sentry-samples check + # The Android sample is a separate build, so the root `check` doesn't reach it checkSampleAndroid: ./gradlew -p sentry-samples/sentry-samples-android check diff --git a/build.gradle.kts b/build.gradle.kts index 0d9138a67e3..57dadd537b7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -71,7 +71,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() @@ -145,9 +145,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 fbbc63d7951..0f4b24d556b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -111,33 +111,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" )