Skip to content

Comments

Exclude META-INF/maven from traces sdk shaded dependencies#8096

Open
laurit wants to merge 1 commit intoopen-telemetry:mainfrom
laurit:jctools-maven
Open

Exclude META-INF/maven from traces sdk shaded dependencies#8096
laurit wants to merge 1 commit intoopen-telemetry:mainfrom
laurit:jctools-maven

Conversation

@laurit
Copy link
Contributor

@laurit laurit commented Feb 17, 2026

@laurit laurit requested a review from a team as a code owner February 17, 2026 13:49
@codecov
Copy link

codecov bot commented Feb 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.22%. Comparing base (8aea961) to head (3097ae5).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8096   +/-   ##
=========================================
  Coverage     90.21%   90.22%           
  Complexity     7606     7606           
=========================================
  Files           841      841           
  Lines         22923    22923           
  Branches       2291     2291           
=========================================
+ Hits          20680    20682    +2     
+ Misses         1526     1524    -2     
  Partials        717      717           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this out locally, ran ./gradlew :sdk:trace:publishToMavenLocal, inspected the opentelemetry-sdk-trace jar and still see JC tool resources in META-INF.

Image

@laurit
Copy link
Contributor Author

laurit commented Feb 17, 2026

I checked this out locally, ran ./gradlew :sdk:trace:publishToMavenLocal, inspected the opentelemetry-sdk-trace jar and still see JC tool resources in META-INF.

Not really unexpected. Like in instrumentation repo for shading we first build a jar with shaded dependencies, then we extract it and in the module where we wish to include the shaded dependency we copy the directory that we extracted in the previous step. The consequence of that is that you may need to clean both the final target module and the module that does the shading to get the files removed.

@jack-berg
Copy link
Member

The consequence of that is that you may need to clean both the final target module and the module that does the shading to get the files removed.

Ok so for this PR to be useful, would someone (you or I) need to go the extra step and clean the final target module?

@trask
Copy link
Member

trask commented Feb 18, 2026

This is what I see locally when I check out the PR:

./gradlew clean :sdk:trace:publishToMavenLocal
jar tf ~/.m2/repository/io/opentelemetry/opentelemetry-sdk-trace/1.60.0-SNAPSHOT/opentelemetry-sdk-trace-1.60.0-SNAPSHOT.jar | grep META-INF

META-INF/
META-INF/MANIFEST.MF
META-INF/native-image/
META-INF/native-image/io.opentelemetry/
META-INF/native-image/io.opentelemetry/opentelemetry-sdk-trace/
META-INF/native-image/io.opentelemetry/opentelemetry-sdk-trace/reflect-config.json

@jack-berg
Copy link
Member

😮

Something's up @trask. I just reran your exact command on my local copy of the branch, after being sure to delete the 1.60.0-SNAPSHOT directory:

opentelemetry-java git:(jctools-maven) jar tf ~/.m2/repository/io/opentelemetry/opentelemetry-sdk-trace/1.60.0-SNAPSHOT/opentelemetry-sdk-trace-1.60.0-SNAPSHOT.jar | grep META-INF
META-INF/
META-INF/MANIFEST.MF
META-INF/maven/
META-INF/maven/org.jctools/
META-INF/maven/org.jctools/jctools-core/
META-INF/maven/org.jctools/jctools-core/pom.properties
META-INF/maven/org.jctools/jctools-core/pom.xml
META-INF/native-image/
META-INF/native-image/io.opentelemetry/
META-INF/native-image/io.opentelemetry/opentelemetry-sdk-trace/
META-INF/native-image/io.opentelemetry/opentelemetry-sdk-trace/reflect-config.json

@laurit
Copy link
Contributor Author

laurit commented Feb 19, 2026

Ok so for this PR to be useful, would someone (you or I) need to go the extra step and clean the final target module?

So far I have treated this as a local build issue. You could try ./gradlew clean :sdk:trace:publishToMavenLocal --no-build-cache and see if that changes anything. Look at sdk/trace-shaded-deps/build/extracted/shadow/META-INF if all goes well you shouldn't see maven there. If it is not there but is in the final jar then probably the final jar wasn't rebuilt and came form build cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants