spring boot启动:
1:默认启动方法
public static void main(String[] args) { SpringApplication.run(UserServiceApplication.class, args); }
2:指定配置文件启动
public static void main(String[] args) { new SpringApplicationBuilder(MyConfigApp.class).properties( "spring.config.location=classpath:/abc.properties").run(args); }
3:启动是添加配置
public static void main(String[] args) { new SpringApplicationBuilder(MyConfigApp.class).properties( "spring.profiles.active=windows", "server.port=9999").run(args); }
原文地址:https://www.cnblogs.com/chenglc/p/8322172.html
时间: 2024-08-04 05:41:58