Skip to content

fix(license): preserve exact Maven headings and legal notice tables - #1458

Merged
mstykow merged 1 commit into
mainfrom
fix/maven-license-detection
Oct 14, 2026
Merged

mstykow merged 1 commit into
mainfrom
fix/maven-license-detection

Conversation

@mstykow

@mstykow mstykow commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Maven “Project Licenses” pages could lose an exact Apache-2.0 heading when a longer partial rule reused the same tokens and won overlap refinement. Discard partial sequence matches that add no query tokens beyond exact, non-clue matches of the same expression, preserving the complete reference as a detection.

License tables in LICENSE, LICENCE, COPYING, NOTICE, and copyright files now retain their declarations, including plural third-party notices/license filenames. README comparison-table pruning and negative/comparative-mention filters remain covered by regression tests. Scanner contract tests exercise the Maven heading in isolation and in a page, plus Apache, BSD, and MPL links across legal-notice filenames.

The CI advisory gate also required a targeted lockfile update from rustls 0.23.45 to 0.23.46 (RUSTSEC-2026-0346 through RUSTSEC-2026-0349). Dependency policy passes without exceptions.

Issues

Closes #1456.

How to verify

Unzip the issue attachment and run cargo run --bin provenant -- --license --json-pp - --strip-root maven-apache. All three files should report apache-2.0; repeat with --compat-mode scancode for the compatibility lane.

Follow-up work

The nearby-case investigation found cross-license partial matches that suppress BSD headings or add unrelated licenses to MPL headings. Reproductions and evidence are recorded in #1457; this fix deliberately requires identical license expressions.

Expected-output fixture changes

Adds a truncated Maven page and the small Markdown table from the issue, with generated license goldens. The page retains its exact Apache references and both fixtures yield an Apache-2.0 detection. Existing expected outputs are unchanged.

🤖 Prepared with Codex.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous filename issue is fixed and no new actionable issues were found.

Summary

Preserves exact Maven license headings and declarations in legal-notice tables.

  • Maven license headings keep their exact Apache-2.0 match.
  • Legal-notice tables keep their component license matches.
  • The lockfile now pins rustls at version 0.23.46.

The previous finding is addressed. No new actionable issues were found. Tests were inspected, not executed.

Reviews (2) · Last reviewed commit: "fix(license): preserve exact Maven headi..." · Reviewed by Greptile

Comment thread src/scanner/process/license.rs
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
@mstykow
mstykow force-pushed the fix/maven-license-detection branch from 74cfce9 to b2f2367 Compare October 14, 2026 17:15
@mstykow
mstykow merged commit e39bd3f into main Oct 14, 2026
13 checks passed
@mstykow
mstykow deleted the fix/maven-license-detection branch October 14, 2026 17:31
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.

Apache-2.0 not detected in Maven "Project Licenses" pages

1 participant