Home > Java > javaTutorial > body text

Idea What are the common methods for springboot springCloud hot loading and hot debugging?

王林
Release: 2023-05-18 17:43:23
forward
899 people have browsed it

Scenario Description

During the project development process, the project needs to be restarted every time it needs to be modified and debugged, which wastes a lot of time. The following are two common methods I compiled

Method 1

Modify the startup configuration method (mainly for debug mode)
Click startup configuration = 》edit configrations…

Idea What are the common methods for springboot springCloud hot loading and hot debugging?

##Configuration below to modify Updateclasses and resources

on ‘update‘ action: Update shortcut key when the user actively performs an update: Ctrl F9

on frame deactication: Update when the editing window loses focus

Idea What are the common methods for springboot springCloud hot loading and hot debugging?

Idea What are the common methods for springboot springCloud hot loading and hot debugging?##Method 2

SpringBoot- dev-tools hot deployment

Instructions

When the developer introduces spring-boot-devtools into the project, as long as there is a change in the classpath path, the project will automatically restart, which greatly Improved project development speed. If the developer uses Eclipse, after modifying the code and saving it, the project will automatically compile and trigger a restart. If the developer uses IntelliJ IDEA, by default, the developer needs to manually compile before triggering a restart. When compiling manually, click the Build -> Build Project menu or press the Ctrl F9 shortcut key to compile. After successful compilation, the project will be restarted. Of course, developers using IntelliJ IDEA can also configure automatic compilation of projects. Configuration steps:
1.idea starts automatic compilation

File=》Settings=》Build,Execution,Deployment=》Compiler= 》Check Build project automeatically

Idea What are the common methods for springboot springCloud hot loading and hot debugging?Ctrl shifter alt / =》Registry=》Check compiler.automake.allow.parallel

Idea What are the common methods for springboot springCloud hot loading and hot debugging?

Idea What are the common methods for springboot springCloud hot loading and hot debugging?2.Introduce jar

		<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
Copy after login
3.Add configuration to application.properties file
#热部署默认会重启
spring.devtools.restart.enabled=true
#添加那个目录的文件需要restart
spring.devtools.restart.additional-paths=src/main/java
#排除那个目录的文件不需要restart
spring.devtools.restart.exclude=static/**,public/**
Copy after login

The above is the detailed content of Idea What are the common methods for springboot springCloud hot loading and hot debugging?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template