From be75a3c5f2efabc767f62a45e6b60a814acc66e1 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Tue, 27 Aug 2024 21:17:21 +0200 Subject: [PATCH] [MNG-8218] Always normalize Path in PathSource (possible fix) --- .../main/java/org/apache/maven/api/services/PathSource.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/services/PathSource.java b/api/maven-api-core/src/main/java/org/apache/maven/api/services/PathSource.java index 4ceda1c8ae72..c6bd252fd6a5 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/services/PathSource.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/services/PathSource.java @@ -35,8 +35,8 @@ class PathSource implements ModelSource { } PathSource(Path path, String location) { - this.path = path; - this.location = location != null ? location : path.toString(); + this.path = path.normalize(); + this.location = location != null ? location : this.path.toString(); } @Override @@ -65,7 +65,7 @@ public ModelSource resolve(ModelLocator locator, String relative) { Path path = getPath().getParent().resolve(norm); Path relatedPom = locator.locateExistingPom(path); if (relatedPom != null) { - return new PathSource(relatedPom.normalize(), null); + return new PathSource(relatedPom); } return null; }