- pom文件添加依赖包
-
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><fork>true</fork><!--必须添加这个配置--></configuration></plugin></plugins>
- idea 里面配置自动编译
使用快捷键打开,选择Registry
mac快捷键 Shift+Command+Alt+/
选择compiler.automake.allow.when.app.running ,重启idea就行!!!