idea使用spring boot 热更新、热加载
16lz
2021-01-22
修改代码后无需重新make、build、run项目,直接看到结果
两种方式
第一种:适合Idea自动装载的Run或Debug
1、Settings->Build project automatically
2、Ctrl+Shift+A ->搜索registry,找到Registry...,注意是后面有三个点的那个,然后找到compiler.automake.allow.when.app.running,勾选
第二种:这种方式不支持idea自动装载的run和debug,
Spring boot 提供了devtools,添加依赖,同时在settings里设置Build project automatically
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
配置好后使用命令启动 mvn spring-boot:run
推荐使用第一种方法
更多相关文章
- Android两种方式监听短信内容---BroadcastReceiver和ContentObse
- Android 自动编译、打包生成apk文件 1 - 命令行方式
- android 命令修改时间或程序修改系统时间
- 【Android学习】数据传递三种方式
- 使用Android保护RESTful服务的最佳方式
- 常用命令(Linux、Android、adb)
- 以编程方式将位置模式更改为高精度Android
- android异步的几种方式
- Cocos2d-x 3.0 开发(十七)使用Cocos2d-x 3.0rc,一条命令打包Android