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); }