springboot使用外置的tomcat启动注意事项

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);

    }

你可能感兴趣的:(springboot使用外置的tomcat启动注意事项)