@SpringBootApplication public class Application extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Application.class); } }
After encapsulation, it cannot run, and a tomcat startup error that the class cannot be found is reported. After being trapped for 2 days, it is finally found that the declaration sources (Application.class) must be displayed ;