项目需要另一个子项目Utils的一个util工具类,在A项目的maven中加入了该子项目
<dependency>
<groupId>com.supconit.data.algorithm.platform</groupId>
<artifactId>data_algorithm_util</artifactId>
<version>1.1.00.190408-SNAPSHOT</version>
</dependency>
但是该工具类的执行依赖一个conf文件,把子项目Utils打成jar包后,发布到linux平台上,发现无法读取该配置文件,报错如下:
java.io.FileNotFoundException: class path resource [fdfs_client.conf] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/home/data_algorithm/data_algorithm_executor-1.1.00.190408-SNAPSHOT.jar!/BOOT-INF/lib/data_algorithm_util-1.1.00.190408-SNAPSHOT.jar!/fdfs_client.conf
修改之前的代码
String path = new ClassPathResource("fdfs_client.conf").getFile().getAbsolutePath();
ClientGlobal.init(path);
修改之后的代码
ClassPathResource classPathResource &#