Spring Boot 如何以 Web 應用的方式啓動

在 Spring Boot 啓動的時候,在進程完成後會自動退出。web

如何讓 Spring Boot 以 Web 方式啓動,而且進程不退出呢?spring


須要肯定下 Web 的這個依賴是否在你的依賴中。spring-boot

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

若是沒有的話,你須要講上面的依賴添加到你的項目中。spa

而後再從新啓動後,你會發現你的 Web 應用沒有在完成後自動退出了。code

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

相關文章
相關標籤/搜索