Skip to content

Commit 119b6f8

Browse files
adinauerclaude
andcommitted
build(opentelemetry): Fail agent shadow duplicates by default
Set the final agent shadowJar to fail on unexpected duplicate entries while still allowing service descriptors to merge in the bootstrap and inst paths. This keeps duplicate handling strict without breaking the service file transformers Shadow still relies on. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 327123a commit 119b6f8

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,10 @@ tasks {
150150

151151
archiveClassifier.set("")
152152

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
153+
duplicatesStrategy = DuplicatesStrategy.FAIL
154+
155+
filesMatching("META-INF/services/**") { duplicatesStrategy = DuplicatesStrategy.INCLUDE }
156+
filesMatching("inst/META-INF/services/**") { duplicatesStrategy = DuplicatesStrategy.INCLUDE }
158157

159158
// Shadow 9.x only applies relocations to service files handled by a ServiceFileTransformer.
160159
// We need two mergeServiceFiles calls:

0 commit comments

Comments
 (0)