Fix path problem on Windows - Fixes gh-2155 (#2160)

This commit is contained in:
woshikid
2022-09-23 23:00:25 +08:00
committed by GitHub
parent 10546f52ab
commit 2a9730c95b

View File

@@ -264,6 +264,8 @@ public class NativeEnvironmentRepository implements EnvironmentRepository, Searc
locations = new String[] { matcher.group(2) };
}
}
name = name.replace("\\", "/"); // change windows path '\' into '/'
name = name.replaceAll("\\[(?=\\w:)", "[/"); // change [D:/path] into [/D:/path]
name = name.replace("applicationConfig: [", "");
name = name.replace("file [", "file:");
name = name.replace("class path resource [", "classpath:/");