1. 程式人生 > >構建SpringBoot-web工程的步驟,以及熱部署問題

構建SpringBoot-web工程的步驟,以及熱部署問題


建立一個springboot-web工程的步驟:


1、建立一個maven工程
2、引入springboot依賴的parent座標(springboot_start_parent)以及web工功能spring_start_parent_web)的座標
3、編寫springboot的引導類,並使用註解@SpringBootApplication宣告為引導類,建立一個main方法,使用SpringApplication.run()方法載入該類的位元組碼檔案
4、編寫程式碼

springboot-web的熱部署問題:

只需要一步:
新增springboot的熱部署依賴:

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

關於熱部署不成功(mac):
preference→complie→build project automatically勾選
shift+option+command+/ → Registry →compiler.automake.allow.when.app.running勾選