在maven中文件位置
String path = Demo.class.getClassLoader().getResource("").getPath();
String path = Demo.class.getResource("").getPath();
maven中获取resources目录路径
原文:https://www.cnblogs.com/sheldonxiun/p/12862961.html