IDEA 配置Springboot项目热部署
2019-09-18 23:20
1856 查看
实现的方式概述
注意以下的热部署方式在IDEA是默认没有打开自动编译的,手动编译需要快捷键(Ctrl+Shift+F9),自动编译的修改配置如下:(注意刷新不要太快,会有1-2秒延迟)
File-Settings-Compiler-Build Project automatically
spring-boot-devtools
在pom中直接引入依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</opti 1af3 onal> </dependency>
设置以下两项(第一项如已设置直接设置第二项)
1) “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。
2) 组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running”
之后直接正常run即可!
spring-loaded
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <!-- spring热部署 --> <dependency> <groupId>org.springframework</groupId> <artifactId>springloaded</artifactId> <version>1.2.6.RELEASE</version> </dependency> </dependencies> </plugin> </plugins> </build>
如果依赖提示not found,先在上面写让maven下载下来,再移到Plugin里面来
命令行窗口启动
找到pom.xml的路径,IDEA的话打开Pom后在标签页鼠标悬停即可看到,或者在pom上右击->file Path
在这个路径下打开cmd窗口(win下可以通过shift快速在对应路径打开),输入启动命令
mvn spring-boot:run
这样就可以在IDE里修改代码实现热加载了!
还没关注我的公众号?
- 扫文末二维码关注公众号【小强的进阶之路】可领取如下:
- 学习资料: 1T视频教程:涵盖Javaweb前后端教学视频、机器学习/人工智能教学视频、Linux系统教程视频、雅思考试视频教程;
- 100多本书:包含C/C++、Java、Python三门编程语言的经典必看图书、LeetCode题解大全;
- 软件工具:几乎包括你在编程道路上的可能会用到的大部分软件;
- 项目源码:20个JavaWeb项目源码。
相关文章推荐
- SpringBoot+idea项目热部署配置
- idea 中配置 spring-boot 项目热部署
- Idea SpringBoot项目 配置 热部署
- 【死磕springboot2.0】idea中springboot项目进行热部署配置。
- Spring Boot与前端配合与Idea配置部署操作过程
- spring boot项目相关配置用war包部署到tomcat下详细教程
- spring-boot项目(idea工具)热部署(亲测有效)
- springboot idea 热部署配置
- springboot部署到阿里云,配置https,springboot项目同时支持http和https请求,阿里云配置https
- Intellij IDEA 搭建Spring Boot项目(二)spring-dao的相关配置
- Spring Boot 配置 IDEA和DevTools 热部署的方法
- 在idea里面如何对spring boot项目进行热部署
- springboot学习(一)IDEA创建springboot项目并部署到华为云中
- SpringBoot【IDEA下配置热部署】
- idea实现热部署springboot项目
- Docker - 通过IDEA和Dockerfile部署springboot项目
- Idea对springboot项目的jar包部署
- IntelliJ IDEA Spring Boot 项目添加热部署
- spring boot项目在idea的热部署方法
- IDEA下开发SpringBoot项目,实现代码的热部署/热加载