Spring Boot 2.0 中 Tomat 嵌入式定制 :使用WebServerFactoryCustomizer
Spring Boot 2.0.x
// @Bean public WebServerFactoryCustomizer webServerFactoryCustomizer(){ return new WebServerFactoryCustomizer<ConfigurableServletWebServerFactory>() { @Override public void customize(ConfigurableServletWebServerFactory factory) { factory.setPort(8083); } }; }