开启
设置Idea Ctrl+Alt+S 查找make project automatically --> 选中
设置Idea Ctrl+Alt+S 输入: Registry compiler.automake.allow.when.app.running
pom.xml配置:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork> //该配置必须
</configuration>
</plugin>
</plugins>
说明:
新建一个类与方法修改都能启动