취미겸생업

[Spring boot] IntelliJ Thymeleaf Live Reloading 본문

IT/Spring Boot

[Spring boot] IntelliJ Thymeleaf Live Reloading

nohumb 2026. 4. 12. 03:48
SMALL

문제 상황

Thymeleaf로 View 개발 시 HTML, CSS와 같은 정적 파일의 실시간 반영이 필요했다.

React, Flutter와 같은 프론트엔드 전용 프레임워크는 Hot Reloading이 지원되지만 Thymeleaf는 Spring boot의 DevTools 라이브러리를 이용해야 한다.

해결법

  • application-dev.yml (전역 Profile에 적용하면 배포 환경에서 Caching이 비활성화 됨)
spring:
  thymeleaf:
    cache: false
  • build.gradle (Develop 환경에서만 참조함)
dependencies {
      // Dev-tools
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    }
  • IntelliJ 설정
    • Edit Configurations
    • Modify options
    • On ‘Update’ action, On frame deactivation 옵션 추가
      • Update classes and resources : 클래스 또는 정적 리소스 수정 시 Rebuild, Rerun
      • On ‘Update action : 해당 파일 저장 시 트리거
      • On ‘Update action : 해당 파일에 대한 포커스를 잃을 시 트리거
LIST

'IT > Spring Boot' 카테고리의 다른 글

[Spring boot] @Scheduled  (0) 2026.06.23
[Spring boot] JPA Projection  (0) 2026.04.17
[Spring boot] Kakao OAuth 소셜로그인 수동 구현  (0) 2026.04.01
[Spring boot] Null과 Builder  (0) 2026.04.01
[Spring boot] Unit Test에 관해  (0) 2025.04.10