gnodet commented on code in PR #12743:
URL: https://github.com/apache/maven/pull/12743#discussion_r3891205175


##########
maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java:
##########
@@ -153,6 +155,24 @@ public void validateRawModel(Model m, ModelBuildingRequest 
request, ModelProblem
         } else if (request.getValidationLevel() >= 
ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0) {
             Severity errOn30 = getSeverity(request, 
ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0);
 
+            Severity errOn31 = getSeverity(request, 
ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1);
+
+            // [MNG-8129] Validate that relativePath does not contain 
characters that are illegal in filesystem paths

Review Comment:
   Good point — "illegal in filesystem paths" is too broad. Updated the comment 
to be precise:
   
   > Validate that relativePath does not contain characters reserved on Windows 
(NTFS).
   > These cause InvalidPathException in Maven 4 when resolved via 
java.nio.file.Path, and typically
   > indicate the user put a GAV coordinate (e.g. "g:a:v") instead of an actual 
filesystem path.
   
   The characters banned here (`:` `"` `<` `>` `|` `?` `*`) come from the 
existing `ILLEGAL_FS_CHARS` constant (minus `\` and `/` which are path 
separators). The same set is already used to validate versions and repository 
IDs. On NTFS these are reserved and `java.nio.file.Path` throws 
`InvalidPathException`; on ext4/HFS+ they're technically valid but a `:` in 
`<relativePath>` almost always means someone wrote `groupId:artifactId` 
notation instead of an actual path.
   
   No Maven-level escaping or URL paths involved — `<relativePath>` is meant to 
be a literal filesystem path relative to the POM's directory.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to