honey_pot

Spring Boot Devtools 기능 사용 본문

SpringBoot

Spring Boot Devtools 기능 사용

_tera_ 2021. 12. 1. 21:43
  • Automatic Restart : classpath에 있는 파일이 변경될 때마다 애플리케이션 자동 재시작
  • Live Reload : 정적 자원(html, css, js) 수정 시 새로 고침 없이 바로 적용
  • Property Defaults : 개발하는 과정에서 캐싱 기능을 사용하지 않기 위해 cache 기본값 false로 설정

 

Automatic Restart

 

pom.xml 에 의존성 추가하기

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
		</dependency>

Shift 2번 연속으로 누르면 나오는 검색창에 Actions 탭에서 registry 검색

체크 항목

 

 

Live Reload 적용

 

application.properties 에 추가

#Live Reload 기능 활성화
spring.devtools.livereload.enabled=true

 

구글 크롬 웹 스토어에서 LiveReload 설치, 설정 확인

애플리케이션 재구동 없이 html 같은 변경된 리소스를 반영할 수 있다.

 

 

Property Defaults 적용하기

 

application.properties 에 추가

#Thymeleaf cache 사용 중지
spring.thymeleaf.cache=false
Comments