StringBoot 启动错误,can not find file [****.properties]

it2025-08-04  5

StringBoot 启动错误 SpringBoot 启动时加载配置文件提示找不到该文件 在项目 ****/src/main/resources目录下找不到这个文件 猜测可能是引入的依赖包中用到了这个文件 1、如果你可以很容易的定位到那个类用了那个配置文件,可以在启动的时候不加载这个类

@ComponentScan(basePackages = {}, //***加载的时候排除掉这个类 xxx excludeFilters = {@ComponentScan.Filter( type = FilterType.ASSIGNABLE_TYPE, classes = {FeignConfig.class,xxx.class} )} ) public class PlatformApplication { public static void main(String[] args) { ApplicationContext ctx = SpringApplication.run(PlatformApplication.class, args); //print env profile info String[] activeProfiles = ctx.getEnvironment().getActiveProfiles(); for (String profile : activeProfiles) { log.info("order-test starting by profile: {} =============================== {} ====== {} ====== {}", profile, profile, profile, profile); } log.info("startup successfully"); } }
最新回复(0)