@SpringBootApplication //继承SpringBootServletInitializer子类 public class Demo2Application extends SpringBootServletInitializer { //重写configure方法 @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Demo2Application.class); } public static void main(String[] args) { SpringApplication.run(Demo2Application.class, args); } }
原文:https://www.cnblogs.com/windpoplar/p/12199084.html