SpringBoot+thymeleaf热部署

简介

	在学习微服务架构的时候遇到各种坑,这里对整合springboot+thymeleaf热部署进行一个简单的描述和记录。

热部署主要依赖

这里springboot版本2.1.10.RELEASE。
	<!--热部署插件-->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-devtools</artifactId>
		<version>2.1.9.RELEASE</version>
		<!--注意-->
		<optional>true</optional>
	</dependency>

	
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<!--注意-->
				<configuration>
					<fork>true</fork>
				</configuration>
			</plugin>
		</plugins>
	</build>

配置文件

spring:
  application:
    name: spring security
  thymeleaf:
    mode: HMTL5
    encoding: UTF-8
    #热部署
    cache: false

剩下的步骤(使用idea)

  • 快捷键shift+ctrl+alt+/打开设置

在这里插入图片描述

  • 选择以下内容打勾并且应用

在这里插入图片描述

  • 再进行最后的环境设置并且应用

在这里插入图片描述

  • 设置完成后重启idea,热部署生效!
发布了7 篇原创文章 · 获赞 1 · 访问量 400

猜你喜欢

转载自blog.csdn.net/qq_35427539/article/details/103401684