chore(bq jdbc): change uber jar bundling rules#12195
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the uber JAR bundling process for the BigQuery JDBC driver. It introduces specific Maven Shade plugin transformers to correctly aggregate and include Apache license and notice information, while simultaneously removing the previous exclusions for these files. This ensures that the final bundled JAR properly contains all necessary legal metadata. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the pom.xml to correctly handle license and notice files during the Maven shade process by adding ApacheLicenseResourceTransformer and ApacheNoticeResourceTransformer, and removing the general exclusion of META-INF/LICENSE* and META-INF/NOTICE*. However, a potential issue was identified where removing these wildcard exclusions without explicit transformers for all possible license file names (e.g., LICENSE.md) could lead to license information loss or compliance problems due to file overwrites in the shaded JAR. It is recommended to use AppendingTransformer for any non-standard license file names.
| <artifact>*:*</artifact> | ||
| <excludes> | ||
| <exclude>META-INF/LICENSE*</exclude> | ||
| <exclude>META-INF/NOTICE*</exclude> |
There was a problem hiding this comment.
Removing these wildcard excludes for LICENSE* and NOTICE* can lead to license information being lost. Files matching these wildcards but not named LICENSE or NOTICE (e.g., META-INF/LICENSE.md, META-INF/LICENSE-MIT.txt) will now be included in the uber JAR.
If multiple dependencies provide a file with the same path, one will overwrite the other, which can create license compliance issues.
To prevent this, consider using AppendingTransformer for other known license file names to merge their content. For example:
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/LICENSE.md</resource>
</transformer>This would require identifying all such non-standard license files in your dependencies and adding a transformer for each.
Add transformer for notice/license & remove them from exclusion list