Spring boot 打jar包获取static 目录下配置文件
普通情况下可以获得static目录,可是打jar后就获取不到了,因为没有tagert目录
之前是通过下面方法进行获取,可是打jar包后过去不到了
files = new File(ResourceUtils.getURL("classpath:static").getPath());

获取方法
ClassPathResource resource = new ClassPathResource("static/socketlist.xml"); InputStream in = resource.getInputStream();
浙公网安备 33010602011771号