由于在rpc服務(wù)中使用了System.getProperty("user.dir")方式去獲取當(dāng)前srv項(xiàng)目的絕對(duì)路徑
使用過程如下:
String userDir = System.getProperty("user.dir");
String home = userDir.substring(0, userDir.lastIndexOf('/'));
System.setProperty("home", home);
項(xiàng)目文件目錄結(jié)構(gòu)如下
Paste_Image.png
String locationPath = StringUtils.join(
new String[]{
System.getProperty("home"),
"config",
"init",
"location.txt" },
File.separator);