1.将resources中的模板文件放入jar包同级文件夹内
例如 resources/template/xx.xlsx 将template文件夹复制到jar包同级文件夹内
2.在方法内引用模板文件
读取为文件输入流
ClassPathResource fpr = new ClassPathResource("template/xx.xlsx");
FileInputStream is = new FileInputStream(fpr.getPath());