关于SpringBoot在idea中实现热部署

来源:互联网 发布:世界20大软件 编辑:程序博客网 时间:2024/05/18 01:56

关于SpringBoot在idea中实现热部署

注意:开启热部署后不要频繁ctrl+s保存,因为一旦保存就会重新部署,你只需要在需要的时候ctrl+s即可,jrebel中可以设置自动部署的间隔时间,可是dev-tools就不清楚了

SpringBoot项目中

在pom.xml中

dependencies标签中

<!--springBoot工程实现热部署--><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>

application.properties/application.yml中

Thymeleaf,Freemarker,Groovy,Velocity等视图页面禁用缓存

spring.thymeleaf.cache=falsespring.freemarker.cache=falsespring.groovy.template.cache=falsespring.velocity.cache=false

IDEA中

开启自动编译

File->Other Settings->Default Settings找到全局设置界面 ->

Build,Execution,Deployment -> Gradle-Android Compiler -> 勾选 Make project automatically(only works while not running / debugging)

修改idea行为

CTRL + SHIFT + A –>输入并进入Registry–>勾选 compiler.automake.allow.when.app.running

Google Chrom浏览器中

禁用缓存

CTRL+SHIIFT+J进入开发者界面中 -> Network 选项 -> 勾选Disable cache

阅读全文
0 0
原创粉丝点击