我的应用程序在主文件夹和测试资源文件夹中都有application.yml,但是应用程序(带有Maven的Springboot2.4中)却报告没有找到application.properties。Caused by: java.io.FileNotFoundException: class path resource [application.properties] cannot be openedbecause it does not exist
at org.springframework.core.io.ClassPathRes
classes) - web.xml其中web.xml和main-servlet.xml是配置xml的 return bean;}Caused by: java.io.FileNotFoundExceptionmain-servlet.xml] cannot be opened because it d
还添加了https://github.com/elishaterada/heroku-google-application-credentials-buildpack.git构建包。Caused by: java.io.FileNotFoundException: class path resource [google-credentials.json] cannot be openedbecause it does not exist
at org.springframework.core.io.ClassP
因此,我将类路径设置为Conf,并尝试获取子目录和文件。 我尝试使用ClassPathResource来实现这一点。如果是file,则可以很好地工作。当涉及到目录时,我面临着一些问题。我正在使用jar应用程序接口来获取目录路径,以遍历该目录中的子目录,这会导致getFile执行中出现问题。 下面是我的代码: 下面的代码是读取Conf文件夹中的子目录。List<Map<String,String>> list = new ArrayList<Map<String,String>>();
<em