注意:jar包里如果有application.properties文件,会覆盖编程里指定的配置文件
@SpringBootApplication
public class IogTagApp {
public static void main(String[] args) throws Exception{
// SpringApplication.run(IogTagApp.class, args);
Properties defaultProperties = new Properties();
InputStream in;
try {
in = new FileInputStream("/app/conf/application.properties");
defaultProperties.load(in);
in.close();
} catch (IOException e) {
}
SpringApplication app = new SpringApplication(IogTagApp.class);
app.setDefaultProperties(defaultProperties);
app.run(args);
}