pom.xml
-
Adicionar spring-boot-devtools
-
Adicionar fork ao true
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!--编译时不会打包-->
<scope>runtime</scope>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--添加<fork>true</fork>-->
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
Configuração IDEA
- Verifique e configure o projeto Build automaticamente em Preferências
- Verifique e configure o compiler.automake.allow.when.app.running no cmd + alt + shift + / Registry