美文网首页
springboot 项目在intelliJ Idea实现热部署

springboot 项目在intelliJ Idea实现热部署

作者: lvlvforever | 来源:发表于2018-01-23 22:34 被阅读21次

自从springboot 1.3之后,springboot提供了一个spring-boot-dev-tools工具,可以实现项目更改代码后重新加载,这样就能快速的查看效果。闲言少叙,为了达到这种效果,需要配置两方面的内容。

intelliJ Idea方面

1 开启自动make功能

(1)settings-build-compiler


image.png

老一点的intelliJ 是make project automatically
我的新版本的是build project automatically
(2)ctrl+shift+a 找到registry 勾选compiler.automake.allow.when.app.running,重启idea


image.png
image.png

2 springboot项目方面

(1)pom中添加spring-boot-dev-tools依赖,注意加上optional=true


image.png

(2)在spring-boot-maven-plugin中加上fork=true配置


image.png

这样就可以了。此文参考了链接

相关文章

网友评论

      本文标题:springboot 项目在intelliJ Idea实现热部署

      本文链接:https://www.haomeiwen.com/subject/iibeaxtx.html