idea开启springboot的devtools自动热部署功能
2023-09-27 14:22:36 时间
1、先在pom文件中添加下面代码段
<!-- 热部署 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <scope>true</scope> </dependency> ---------------------------------------------------- <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!-- 没有该配置,devtools 不生效 --> <fork>true</fork> <addResources>true</addResources> </configuration> </plugin> </plugins> </build>
2、需要修改idea中的两个配置,来开启idea自动编译功能
1 - Enable Automake from the compiler
PRESS: CTRL + SHIFT + A
TYPE: make project automatically
PRESS: Enter
Enable Make Project automatically feature
2 - Enable Automake when the application is running
PRESS: CTRL + SHIFT + A
TYPE: Registry
Find the key compiler.automake.allow.when.app.running and enable it
意思是
1、CTRL + SHIFT + A --> 查找make project automatically --> 选中
2、CTRL + SHIFT + A --> 查找Registry --> 找到并勾选compiler.automake.allow.when.app.running
如果不想做上面这两部勾选,不想让idea开启自动编译部署,那么手动按Ctrl+F9也是可以的,开启这两项在添加springboot应用时,会找不到主类,需要去掉勾选后才能好用,所以idea是不建议开启这两项的,除非springboot已经运行好了,不然建议去掉勾选后再进行添加
相关文章
- 转载:SpringBoot 在IDEA中实现热部署
- 》》》》idea中在项目多模块下springboot 整合thymeleaf ,进行web浏览显示《《《《
- 第二十四章 springboot注入servlet
- 第十一章 springboot + mongodb(简单查询)
- 基于jsp+mysql+mybatis的SpringBoot美容院后台管理系统
- 精品springboot实验室预约管理系统知识分享
- springBoot 入门(一)—— 使用idea创建第一个springBoot项目
- springboot 2.0 配置 spring.jackson.date-format 不生效
- 使用idea创建一个springboot项目,本文不包含ORM部分This application has no explicit mapping for /error, so you are seeing this as a fallback.
- SpringBoot参数校验
- SpringBoot 使用yml配置 mybatis+pagehelper+druid+freemarker实例
- 【Springboot】如何将tomcat替换为jboss
- 【SpringBoot】SpringBoot性能优化
- 【idea】用IDEA把自己的工具类打jar包,并引入到springboot项目中
- idea调试模式下启动Springboot特别慢的原因 Method breakpoints may dramatically slow down debuggin
- idea 启动springboot项目报找不到主类
- 【毕业设计】springboot-毕业生信息招聘平台(视频+论文+源码)
- 用Intellij IDEA创建第一个SpringBoot项目
- springboot:入门篇
- Intellij IDEA基于Springboot的远程调试
- SpringBoot+gradle+idea实现热部署和热加载