Skip to content

Commit c948b26

Browse files
authored
[MNG-8218] Always normalize Path in PathSource (#1684)
1 parent 3f430bb commit c948b26

File tree

1 file changed

+3
-3
lines changed
  • api/maven-api-core/src/main/java/org/apache/maven/api/services

1 file changed

+3
-3
lines changed

api/maven-api-core/src/main/java/org/apache/maven/api/services/PathSource.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class PathSource implements ModelSource {
3535
}
3636

3737
PathSource(Path path, String location) {
38-
this.path = path;
39-
this.location = location != null ? location : path.toString();
38+
this.path = path.normalize();
39+
this.location = location != null ? location : this.path.toString();
4040
}
4141

4242
@Override
@@ -65,7 +65,7 @@ public ModelSource resolve(ModelLocator locator, String relative) {
6565
Path path = getPath().getParent().resolve(norm);
6666
Path relatedPom = locator.locateExistingPom(path);
6767
if (relatedPom != null) {
68-
return new PathSource(relatedPom.normalize(), null);
68+
return new PathSource(relatedPom);
6969
}
7070
return null;
7171
}

0 commit comments

Comments
 (0)