Does not inherit the SpringBootServletInitializer class,
Add a new class under the same level as the project startup class,
/**
* web环境中部署
*/
public class XxlJObAdminServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(XxlJobAdminApplication.class); //参数为启动类的类对象
}
}
Pay attention to the project file hierarchy in the webapp folder