You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2020/01/26 22:40:53 UTC
[maven] 01/02: [MNG-6071] Normalize relative paths for working
directory
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch MNG-6071
in repository https://gitbox.apache.org/repos/asf/maven.git
commit cdb2cd0df38fffa624fb9c50a63b27088a7892a1
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun Jan 26 17:25:18 2020 +0100
[MNG-6071] Normalize relative paths for working directory
---
maven-embedder/src/main/java/org/apache/maven/cli/ResolveFile.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/ResolveFile.java b/maven-embedder/src/main/java/org/apache/maven/cli/ResolveFile.java
index 8622ce3..7a1652e 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/ResolveFile.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/ResolveFile.java
@@ -20,6 +20,7 @@ package org.apache.maven.cli;
*/
import java.io.File;
+import java.nio.file.Paths;
/**
* Resolve relative file path against the given base directory
@@ -43,7 +44,7 @@ public class ResolveFile
}
else
{
- return new File( baseDirectory, file.getPath() ).getAbsoluteFile();
+ return Paths.get( baseDirectory, file.getPath() ).normalize().toFile();
}
}
}