- pom.xml添加依赖
<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配置
File->Settings->Build,Execution,Deployment->Compiler 选中 Build project automatically项。
3. Ctrl+Shift+A ,搜索Registry,双击 "Registry...",找到 compiler.automake.allow.when.app.running 并选中。
启动项目,修改文件,即可自动编译。