- 步骤
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>
</build>
- IDEA配置
idea里面要设置,windows和mac⼀样
settings---->compiler---->build project
- 使用快捷键打开,选择Registry 选择compiler.automake.allow.when.app.running ,重启idea就行!!!
- 注意默认快捷键:
- window快捷键 Shift+Ctrl+Alt+/
- mac快捷键 Shift+Command+Alt+/