在启动类上加入
public class OjBackendGatewayApplication {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(OjBackendGatewayApplication.class);
app.setDefaultProperties(Collections.singletonMap("spring.config.location", "classpath:/application.yaml"));
app.run(args);
}
}
指定从resource目录下加载application.yaml文件