[java] add the LICENSE and NOTICE files to the jars created#17601
[java] add the LICENSE and NOTICE files to the jars created#17601joerg1985 wants to merge 1 commit into
Conversation
Review Summary by QodoInclude LICENSE and NOTICE files in generated JAR artifacts
WalkthroughsDescription• Add LICENSE and NOTICE files to generated JAR files • Create custom java_binary wrapper to include legal files • Update java_library to support resources parameter • Preserve license files when merging JARs with duplicate handling Diagramflowchart LR
A["BUILD.bazel<br/>legal-stuff genrule"] --> B["java_binary.bzl<br/>custom wrapper"]
A --> C["java_library.bzl<br/>resources param"]
B --> D["JAR files<br/>with META-INF/LICENSE"]
C --> D
E["merge_jars.bzl<br/>duplicate handling"] --> D
File Changes1. java/defs.bzl
|
Code Review by Qodo
1. java_binary macro not buildified
|
da90638 to
b11efab
Compare
|
Code review by qodo was updated up to the latest commit b11efab |
|
Code review by qodo was updated up to the latest commit 6cea6a9 |
391e19f to
e26a0df
Compare
|
Code review by qodo was updated up to the latest commit e26a0df |
|
Code review by qodo was updated up to the latest commit 993fd49 |
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
|
looks like the SpotBugs findings are not related to this PR. |
🔗 Related Issues
#16113
💥 What does this PR do?
Add the LICENSE and NOTICE files to the jars created and avoid they are disposed while building a merged jar.
🔧 Implementation Notes
The change to
java/private/merge_jars.bzlis currently not needed, but this might change as we regulary update the dependencies and nobody is looking to deep into the merged jars after this. Therefore i added a inline comment on the intention of this change.🤖 AI assistance
💡 Additional Considerations
When merging the jars we might have duplicates of the files, but this can be ignored in my mind.
We must have them at least once (enforced by the license) but i think there is no limitation.
🔄 Types of changes