zoukankan      html  css  js  c++  java
  • SpringBoot项目不占用端口启动

    @EnableScheduling
    @SpringBootApplication
    public class Application {
    
        public static void main(String[] args) {
            new SpringApplicationBuilder().sources(Application.class).web(false).run(args);
        }
    }

    Starting from Spring Boot 2.0

    -web(false)/setWebEnvironment(false) is deprecated and instead Web-Application-Type can be used to specify

    spring.main.web-application-type=NONE
    @SpringBootApplication
    public class SpringBootDisableWebEnvironmentApplication {
    
        public static void main(String[] args) {
            new SpringApplicationBuilder(SpringBootDisableWebEnvironmentApplication .class)
                .web(WebApplicationType.NONE) // .REACTIVE, .SERVLET
                .run(args);
       }
    }
     

     

    有追求,才有动力!

    向每一个软件工程师致敬!

    by wujf

    mail:921252375@qq.com

  • 相关阅读:
    2019/1/2
    2018/12/22
    2018/12/18
    2018/12/17
    2018/12/16
    编程总结汇总
    学习总结汇总
    第十三周学习总结--助教
    第十一周编程总结
    第10周编程总结
  • 原文地址:https://www.cnblogs.com/wujf/p/9458742.html
Copyright © 2011-2022 走看看