Skip to content

[MNG-8129] Validate relativePath for illegal filesystem characters - #12743

Draft
gnodet wants to merge 1 commit into
apache:maven-3.10.xfrom
gnodet:fix/MNG-8129-windows-invalid-path-3.10.x
Draft

[MNG-8129] Validate relativePath for illegal filesystem characters#12743
gnodet wants to merge 1 commit into
apache:maven-3.10.xfrom
gnodet:fix/MNG-8129-windows-invalid-path-3.10.x

Conversation

@gnodet

@gnodet gnodet commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add validation in DefaultModelValidator to reject <relativePath> values containing characters illegal in filesystem paths (: " < > | ? *)
  • Uses errOn31 severity (WARNING at default strict level) to avoid breaking existing builds
  • Path separators (/ and \) are intentionally excluded from the banned list since the resolver handles them
  • Catches nonsensical values like org.apache:apache early with a clear error message

Note: Maven 3.10.x uses java.io.File for path resolution (not java.nio.file.Path), so there is no InvalidPathException crash — new File() silently accepts any string. The validator check is sufficient for this branch.

Companion to #12740 (master) and #12741 (maven-4.0.x) which also fix the InvalidPathException crash in the Path.resolve() code paths.

Fixes https://issues.apache.org/jira/browse/MNG-8129

🤖 Generated with Claude Code

Reject <relativePath> values containing characters that are illegal
in filesystem paths (: " < > | ? *) during raw model validation.
This catches nonsensical values like "org.apache:apache" early, with
a clear error message, instead of letting them fail silently or crash
on Windows.

The check runs at strict validation level only (project builds), not
for dependency POMs resolved from repositories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant