Spring Boot设置开发模式后,更改文件会重新启动Tomcat服务,避免每次都得先关闭服务,再启动服务。
那么只需要在pom.xml文件里添加以下依赖即可。
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>