Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/JLBP-0018.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ There are a number of problems with shading:
to also roll in the security fix).
- Shading cannot be performed on types used in a library's own public API as return
types or method arguments.
- Service entries under `META-INF/services` can easily be messed up. They need
special effort to be merged because the entries are located in the same place
for every jar.
- Shading often corrupts non-code metadata in META-INF/MANIFEST.mf and other locations.
Comment thread
suztomo marked this conversation as resolved.
Resolved
For instance, service entries under `META-INF/services` are hard
to merge because the entries are located in the same place
for every JAR file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(minor) Not every JAR file has META-INF/services.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's one example of the sorts of problems that can happen. Not every shading will have this problem, or indeed any problem with metadata, but it can crop up.

- Shading doesn't relocate JNI code.
- Shaders either don't support classes loaded by reflection or they replace all
strings matching selected packages in the bytecode, leading to the corruption
Expand Down