版权声明:原创文章欢迎转载,不过要记得加出处哦 https://blog.csdn.net/wljk506/article/details/82526651
spring boot devtools 方式
pox.xml
加入
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional><!--true 热部署才有效,表示覆盖父级项目中的引用-->
<scope>true</scope>
</dependency>
修改或者加入
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
fox.风
配置修改
IDEA开启项目自动编译
WIN
settings
->Build,Execution,Deployment
->compiler
在右侧的配置项中Build project automatically
前面选中
MAC
Preferences
->Build,Execution,Deployment
->compiler
在右侧的配置项中Build project automatically
前面选中
IDEA开启项目运行时自动make
WIN
ctrl + shift + /
搜索命令:registry
-> 勾选compiler.automake.allow.when.app.running
MAC
shift + option + command +/
搜索命令:registry
-> 勾选compiler.automake.allow.when.app.running
spring loaded
修改 或者 加入
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
<dependencies>
<!-- spring热部署-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.8.RELEASE</version>
<scope>provided</scope>
</dependency>
</dependencies>
</plugin>
以下操作
java
文件时,系统会监视classes
文件,当有classes
文件被改动时,系统会重新加载类文件,不用重启启动服务
1. 右键application debug
启动
2. 系统通过mvn spring-boot:run
启动
3. 使用导航栏,快速操作按钮 小乌龟debug
时