Hot deployment
1. Add a hot deployment pom dependency
<!--Hot Deployment plug-in dependent jar package - <Dependency> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-devtools</Artifactid> <Optional>True</Optional> </Dependency>
2. Added in Maven plugin
<plugin> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-maven-plugin</Artifactid> <configuration> <fork>true</fork> </configuration> <dependencies> <!--Spring Hot deployment plug-in <dependency> <groupId>org.springframework</groupId> <artifactid>springloaded</a Rtifactid> <version>1.2.6.RELEASE</version> </dependency> </dependencies> </plugin>
3.idea turn on auto-compile
File=>settings under
4. Key combination: shift+alt+ctrl+/, select "Registry", enter, find "complier.automake.allow.when.app.running" tick
5. Running with the MAVEN command will be automatically compiled and deployed
Debuger
We use the MAVEN command to debug and we find that we can't get in.
1. Add Configuration in Maven plugin
<plugin> <groupId>Org.springframework.boot</groupId> <Artifactid>Spring-boot-maven-plugin</Artifactid> <Configuration> <Fork>True</Fork> <jvmArguments>-xdebug-xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8088 </jvmArguments> </Configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> <Dependencies> <!--Spring Hot Deployment plug-in - <Dependency> <groupId>Org.springframework</groupId> <Artifactid>springloaded</Artifactid> <version>1.2.6.RELEASE</version> </Dependency> </Dependencies> </plugin>
Address is your debug listening port, do not repeat with project Port
2. Add Remote
Port to above tells Maven the listening port
4. Start the project
5. Debug mode to start remote
6 test the code with a breakpoint can be found to enter the breakpoint.
Note: Not only for development environments, but also for local code debugging if the project is published to a line
Spring boot-Hot Deployment and Debugger use (iii)