springboot使用外置的tomcat启动
默认的启动类要继承SpringBootServletInitiailzer类,并复写configure()方法。
@SpringBootApplication
public class OpenApiApplicationextends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(OpenApiApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(OpenApiApplication.class);
}
}
网友评论