[Spring] 코드 수정 자동반영하기 (Reloading)

이수민·2023년 1월 21일
1

spring

목록 보기
2/12

코드를 수정할 때마다 매번 서버를 재실행하는 것이 번거로워, Reloading을 적용해보려 한다.

dependencies 추가

  • build.gradle 파일에 아래 코드를 추가한다.
dependencies {
	...
	developmentOnly 'org.springframework.boot:spring-boot-devtools’
	...
}

preference 설정 (Intellij)

  • File - Settings - Build,Excution,Deployment -> Compiler - Build project automatically 체크
  • File - Settings - Advanced Settings - Allow auto-make to start evem if developed application is currently running 체크

application.properties 설정

  • resources/application.properties 파일에 아래 코드를 추가하여 설정을 완료한다.
spring.devtools.livereload.enabled=true
spring.devtools.restart.enabled=true
profile
BE 개발자를 꿈꾸는 학생입니다🐣

0개의 댓글