Skip to content

Commit c0acbd7

Browse files
committed
fix(otel): use DuplicatesStrategy.INCLUDE for otel agent shadow JAR
Shadow 9.x enforces duplicatesStrategy before transformers run, so DuplicatesStrategy.FAIL prevents mergeServiceFiles from merging inst/META-INF/services/ files that exist in both the upstream OTel agent JAR and the isolated distro libs. Switching to INCLUDE lets the transformer see all duplicates and merge them correctly.
1 parent da7d400 commit c0acbd7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sentry-opentelemetry/sentry-opentelemetry-agent/build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ tasks {
150150

151151
archiveClassifier.set("")
152152

153-
duplicatesStrategy = DuplicatesStrategy.FAIL
153+
// INCLUDE is required so that mergeServiceFiles can see duplicates from both the
154+
// upstream agent JAR and the isolated distro libs before they are deduplicated.
155+
// Shadow 9.x enforces duplicatesStrategy before transformers run, so FAIL/EXCLUDE
156+
// would prevent service file merging.
157+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
154158

155159
mergeServiceFiles { include("inst/META-INF/services/*") }
156160
exclude("**/module-info.class")

0 commit comments

Comments
 (0)