You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2026/08/31 06:13:31 UTC
(maven) branch maven-4.0.x updated: [MNG-8129] Clarify relativePath validation comment (#12965)
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch maven-4.0.x
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/maven-4.0.x by this push:
new 5cecf72ed0 [MNG-8129] Clarify relativePath validation comment (#12965)
5cecf72ed0 is described below
commit 5cecf72ed05bd46e7e33a826ff9ae457924d669a
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon Aug 31 08:13:24 2026 +0200
[MNG-8129] Clarify relativePath validation comment (#12965)
The banned characters are those reserved on Windows (NTFS),
which cause InvalidPathException when resolved via
java.nio.file.Path. They typically indicate the user put a
GAV coordinate instead of a filesystem path.
Co-authored-by: Claude Opus 4.6 <no...@anthropic.com>
---
.../java/org/apache/maven/model/validation/DefaultModelValidator.java | 4 +++-
.../main/java/org/apache/maven/impl/model/DefaultModelValidator.java | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/compat/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java b/compat/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
index 47210ce7a3..f5255cabad 100644
--- a/compat/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
+++ b/compat/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
@@ -160,7 +160,9 @@ public void validateRawModel(Model m, ModelBuildingRequest request, ModelProblem
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
+ // [MNG-8129] Validate that relativePath does not contain characters reserved on Windows (NTFS).
+ // These cause InvalidPathException 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.
if (parent != null
&& parent.getRelativePath() != null
&& !parent.getRelativePath().isEmpty()) {
diff --git a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java
index b3c5ec23a8..b1a805ce64 100644
--- a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java
+++ b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelValidator.java
@@ -443,7 +443,9 @@ public void validateFileModel(Session s, Model m, int validationLevel, ModelProb
Severity errOn30 = getSeverity(validationLevel, ModelValidator.VALIDATION_LEVEL_MAVEN_3_0);
Severity errOn31 = getSeverity(validationLevel, ModelValidator.VALIDATION_LEVEL_MAVEN_3_1);
- // [MNG-8129] Validate that relativePath does not contain characters that are illegal in filesystem paths
+ // [MNG-8129] Validate that relativePath does not contain characters reserved on Windows (NTFS).
+ // These cause InvalidPathException 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.
if (parent != null
&& parent.getRelativePath() != null
&& !parent.getRelativePath().isEmpty()) {