1. Add dependencies
Add the following code to pom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
Copy the code
2. Modify the plug-in
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration><! -- -- -- > new
<fork>true</fork>
</configuration>
</plugin>
Copy the code
3. The configuration idea
4. shift+ctrl+alt+/
5. (Optional) Configure DevTools
application.yml
Spring: devtools: restart: enabled: true # Hot deployment takes effect Addition-Paths: SRC /main/ Java # Additional Java classpath to monitor exclude: Web-inf /** # Path that does not require a restartCopy the code