添加依赖:pom.xml
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> </dependency>
在eclipse下此时就可以了,但是在idea下却无效果,解决如下:pom.xml
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <!--开启热部署--> <configuration> <fork>true</fork> </configuration> </plugin> </plugins> </build>
时间: 2024-11-08 11:40:12