[MNG-8129] Validate relativePath for illegal filesystem characters - #12743
Draft
gnodet wants to merge 1 commit into
Draft
[MNG-8129] Validate relativePath for illegal filesystem characters#12743gnodet wants to merge 1 commit into
gnodet wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DefaultModelValidatorto reject<relativePath>values containing characters illegal in filesystem paths (: " < > | ? *)errOn31severity (WARNING at default strict level) to avoid breaking existing builds/and\) are intentionally excluded from the banned list since the resolver handles themorg.apache:apacheearly with a clear error messageNote: Maven 3.10.x uses
java.io.Filefor path resolution (notjava.nio.file.Path), so there is noInvalidPathExceptioncrash —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
InvalidPathExceptioncrash in thePath.resolve()code paths.Fixes https://issues.apache.org/jira/browse/MNG-8129
🤖 Generated with Claude Code