SpringBoot工程热部署

总体步骤:

  1. 现已有一个创建好的SpringBoot工程
  2. 引入热部署配置(在pom.xml文件中)
        <!--热部署配置 -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<optional>true</optional>
		</dependency>
  1. 进行Setting设置
    “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically”
    在这里插入图片描述
  2. 进行compiler.automake.allow.when.app.running勾选
    组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running”
    在这里插入图片描述
  3. 重启项目将可应用

作用: 热部署可以在启动一次IDEA的情况下,自动进行编译,你不必每次都手动的去点停止和启动了。
注意: 热部署方式在IDEA是默认没有打开自动编译的,手动编译需要快捷键(Ctrl+Shift+F9),自动编译的修改配置如下:(注意刷新不要太快,会有1-2秒延迟)

发布了56 篇原创文章 · 获赞 6 · 访问量 7760

猜你喜欢

转载自blog.csdn.net/ly823260355/article/details/94399315