1、修改pom.xml
2、创建SpringBootServletInitializer的子类
public class SpringApp extends SpringBootServletInitializer{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(DemoApplication.class);
}
}
—其中DemoApplication为项目的启动类