본문 바로가기
Framekwork/SPRING

[자바/스프링] `spring-boot-devtools` 라이브러리 추가

by 아이엠제니 2023. 2. 10.

 

 

✔️ `spring-boot-devtools` 라이브러리를 추가하면, `html` 파일을 컴파일만 해주면 서버 재시작 없이 View 파일 변경 가능

 

💾 build.gradle

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	implementation 'org.springframework.boot:spring-boot-devtools' // 추가
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

 

 

✔️ File > Settings > Compiler > Build project automatically 체크

 

 

그리고 서버 재시작 후!

메뉴 Build > Recompile 을 클릭하면, 변경된 내용을 확인할 수 있다.

Recompile 단축키는 Ctrl + Shift + F9 이다.


변경 전
변경 후


서버가 돌아가는 상태에서 `hh`에서 `gg`로 바꾼 후 리컴파일 한 후 확인을 해봤더니!

잘 적용된 모습을 볼 수 있었다.

300x250