Spring Boot 如何以 Web 应用的方式启动

在 Spring Boot 启动的时候,在进程完成后会自动退出。web


如何让 Spring Boot 以 Web 方式启动,而且进程不退出呢?spring


3363-spring-boot-auto-stop-process-01.jpg


须要肯定下 Web 的这个依赖是否在你的依赖中。ide


        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>


若是没有的话,你须要讲上面的依赖添加到你的项目中。spring-boot


3363-spring-boot-auto-stop-process-02.jpg

 

而后再从新启动后,你会发现你的 Web 应用没有在完成后自动退出了。进程

https://www.cwiki.us/display/SpringBootZH/questions/57938770get

相关文章
相关标签/搜索