Commit 63cf3ef
committed
Fix SPI service file relocation during javaagent shading
When classes are relocated during shading (e.g., io.opentelemetry.instrumentation
to io.opentelemetry.javaagent.shaded.instrumentation), the corresponding SPI files
in META-INF/services/ were not being renamed to match the new class locations.
This fix adds an eachFile block to the Shadow plugin configuration to rename
SPI service files when shading is enabled. Now extensions can use the correct
shaded class names in their SPI files.
Fixes issue where InstrumenterCustomizerProvider and HttpClientUrlTemplateCustomizer
SPI files needed to reference shaded class names but weren't being automatically
renamed during the build process.
Changes:
- Added eachFile transformation to javaagent-shadowing.gradle.kts
- Added eachFile transformation to muzzle-check.gradle.kts
- Added test SPI file to demonstrate functionality
Resolves issue open-telemetry#148251 parent ad6cc1b commit 63cf3ef
File tree
3 files changed
+15
-0
lines changed- conventions/src/main/kotlin
- gradle-plugins/src/main/kotlin
- javaagent-tooling/src/main/resources/META-INF/services
3 files changed
+15
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
55 | 62 | | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments