使用idea开发springboot项目时,可以使用devtools插件,只更新一些变动的类,以达到热更新的目的。

maven插件修改

  1. <plugin>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-maven-plugin</artifactId>
  4. <configuration>
  5. <!--fork:如果没有该项配置,整个devtools不会起作用-->
  6. <fork>true</fork>
  7. </configuration>
  8. </plugin>

编译配置修改

修改勾选,Build project automatically,能够让项目自动编译,以生成新的class文件。

允许运行时编译

修改registry中的 compiler.automake allow.when.app.running 选项。