[intellij] SpringBoot Devtools Remote LiveReload 설정
SpringBoot 설정
SpringBoot LiveReload Document
Spring Boot Reference Documentation
This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe
docs.spring.io
Spring Boot DevTools가 제공하는 기능은 크게 5가지이다
- Property Defaults
- thymeleaf 는 기본적으로 캐싱기능을 사용한다
- 개발과정에서는 불필요하므로 devtools에서 자동으로 기능을 꺼준다
- Automatic Restart
- 개발과정 중 Application을 재시작하는 경우가 많은데 devtools에서 이 기능을 자동으로 제공해준다
- Live Reload
- React 의 Hot Reload 기능을 아시면 정말 편한 기능이다
- devtools 에서 이 기능을 제공하지만 완전한 Hot Reload 는 아니다
- 내부적으로 live reload 서버를 두고 브라우저의 확장 프로그램 LiveReload와 통신하는 방식을 가졌다
- Global Settings
- Dev Properties 관리 기능 제공
- Remote Applications
- 원격 개발 지원
SpringBoot Dependency 추가
developmentOnly 'org.springframework.boot:spring-boot-devtools'
SpringBoot Application 설정 추가
Devtools Properties 자세한 설정 옵션은 Documents 참조
spring:
devtools:
livereload:
# livereload 서버 켜기
enabled: true
remote:
restart:
# 원격 재시작 활성화
enabled: true
intellij 설정
2021.2월 이전 버전 설정 방법
- Window:
ctrl
+shift
+A
- MacOS:
cmd
+shift
+A
Registry... 로 이동
compiler.automake.allow.when.app.running
부분의 체크박스 클릭
2021.2월 이후 버전 설정 방법
Registry
에서 compiler.automake.allow.when.app.running
부분의 체크박스를 클릭해주는 설정은 2021.2월 버전부터 설정방법이 변경됨
Preferences > Advanced Settings 에서Allow auto-make to start even if developed application is currently running
체크박스를 체크해준다
이후 는 동일하게 진행하면 된다
Preferences > Build, Execution, Deployment > Compiler 에서Build project automatically
체크박스를 체크해준다
브라우저 설정
크롬 확장 프로그램 설치 - RemoteLiveReload
RemoteLiveReload를 설치하면 준비 끝
LiveReload가 활성화 되면 아래와 같이 아이콘이 변경된다