标签:enable can span 启动 ble ati rri builder Servle
继承SpringBootServletInitializer可以使用外部tomcat(web容器启动项目),自己可以设置端口号,项目名。
继承之后要实现他的configure方法
1 @SpringBootApplication 2 @MapperScan({"com.eliansun.mapper"}) 3 @EnableRetry 4 public class BaseQuartzApplication extends SpringBootServletInitializer { 5 6 public static void main(String[] args) { 7 SpringApplication.run(BaseQuartzApplication.class, args); 8 } 9 10 @Override 11 protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 12 return builder.sources(BaseQuartzApplication.class); 13 } 14 15 }
不需要用外部tomcat的话继承不继承都可以。
为何要继承SpringBootServletInitializer,为何要实现configure这方法
标签:enable can span 启动 ble ati rri builder Servle
原文地址:https://www.cnblogs.com/lzghyh/p/12343296.html