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

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

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


需要确定下 Web 的这个依赖是否在你的依赖中。

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

如果没有的话,你需要讲上面的依赖添加到你的项目中。

 

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

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

 

posted @ 2020-04-04 23:05  huyuchengus  阅读(337)  评论(0编辑  收藏  举报