Skip to content

fix: validate legal files in packaged jars#3328

Open
He-Pin wants to merge 1 commit into
mainfrom
fix/1470-license-notice-jars
Open

fix: validate legal files in packaged jars#3328
He-Pin wants to merge 1 commit into
mainfrom
fix/1470-license-notice-jars

Conversation

@He-Pin

@He-Pin He-Pin commented Jul 11, 2026

Copy link
Copy Markdown
Member

Motivation

Published jars can silently omit required META-INF/LICENSE and META-INF/NOTICE files. The protobuf-v3 assembly also needs explicit merge handling for legal resources.

Modification

  • Merge LICENSE and NOTICE resources in the protobuf-v3 assembly while retaining the protobuf COPYING file.
  • Add a package validation task that checks both packageBin and the published artifact for required META-INF legal files.
  • Include the validation task in pull request validation for published projects.

Result

Normal package jars and assembly-backed published jars fail validation when either required legal file is missing.

References

Fixes #1470

Motivation:
Published jars can silently omit required META-INF legal files, and the protobuf-v3 assembly needs explicit merge handling.

Modification:
Merge legal resources in the protobuf-v3 assembly and add a validation task for every published project.

Result:
Published package and assembly jars are checked for META-INF/LICENSE and META-INF/NOTICE.

Tests:
- sbt "actor / Compile / checkPackageBinMetaInfLegalFiles" "protobuf-v3 / Compile / checkPackageBinMetaInfLegalFiles" (pass)
- sbt headerCreateAll "+headerCheckAll" scalafmtCheckAll scalafmtSbtCheck (pass)
- scalafmt --list --mode diff-ref=origin/main (pass)
- git diff --check (pass)
- validatePullRequest not run per user request

References:
Fixes #1470
@He-Pin He-Pin added the build sbt or build of the project label Jul 11, 2026
@He-Pin He-Pin added this to the 2.0.0-M4 milestone Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build sbt or build of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

META-INF/LICENSE and META-INF/NOTICE are not consistently added to jars

1 participant