首页 > 编程知识 正文

springboot项目热部署,springcloud实现热部署

时间:2023-05-05 02:40:07 阅读:128644 作者:1444

在web APP应用程序开发中,在调整接口后,不希望始终频繁重新启动APP应用程序,因此要设置以下热点:

这里使用的是IDEA开发工具。

1 .将热部署组件的引用和生成项目插件配置添加到web模块的POM.xml中。

ependenciesdependencygroupidorg.spring framework.boot/groupidartifactidspring-boot-dev tools/artifactidscoperuntime 为了避免数据包冲突--/dependency/dependenciesbuildpluginsplugingroupidorg.spring framework.boot/groupidartifactidspring-boot-moot artifactidexecutionsexecutiongoalsgoalrepackage/goal/goals/execution/executions! -热部署配置--- -在configuration forktrue/fork/configuration/plugin/plugins/build2. idea中,组合“shift ctrl alt /”

3 .在打开的注册中,选择compiler.automake.allow.when.running选项。

4 .然后,对于每个项目,在IDEA设置窗口" settings "中选择" compiler ",并选中" Build project automatically "。

5 .打开浏览器的开发人员工具窗口(例如chrome ),可以选择" network "并选中" Disable cache "。

6 .另外,将配置项:添加到项目的配置文件“application.yml”中,以便每次修改一个class时不会触发APP应用程序的重新启动

#spring devtools类更改程序文件不使用热部署spring.dev tools.restart.enabled 3360 false spring.dev tools.live reload.enabled 3360

8 .以上配置成果测试如下。

1 )修改页面的css文件后,保存即可看到页面更新。

! doctypehtmlhtmllang=' en ' headlinkrel=' style sheet ' type=' text/CSS ' href=' CSS/main.CSS ' link rel=' style ss }

2.)修改页面的html现在也可以立即更新页面。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。