1.maven导入
spring-boot-devtools jar包
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>1.5.8.RELEASE</version>
</dependency>
</dependencies>
2.根据自己编辑器不同进行操作
如果是eclipse直接使用,如果是IDE要进行以下操作
1.
勾选上setting -> Compile ->Build project automatically
2.按住Ctrl+Alt+Shift+/,---->Registry..--->勾上compiler.automake.allow.when.app.running
然后关闭项目,重新启动IDE,ok了