SpringBoot配置多个application.properties文件
Step 1. Create file src/main/resources/META-INF/spring.factories with the following:
org.springframework.boot.env.EnvironmentPostProcessor=\
com.example.YourEnvironmentPostProcessor
Step 2. As an example create a file src/main/resources/custom.properties with:
server.port=8081
Step 3. Now create you post processor class
package com.example;
public class EnvironmentPostProcessorExample implements EnvironmentPostProcessor {
private final PropertiesPropertySourceLoader loader = new PropertiesPropertySourceLoader();
@Override
public void postProcessEnvironment(