본문 바로가기
💻 하나씩 차곡차곡/Back-end

[Spring Boot (스프링부트)] Devtools 기능 및 설정방법

by 뚜루리 2024. 2. 6.
728x90
320x100
[오늘의 궁금증] devtools 가 개발의 편의성을 높여준다고 들었다. 구체적으로 어떻게? 그리고 또 다른 기능이나 역할이 있을까?

 

기능

[Automatic Restart]

  • claapath에 있는 파일이 변경될 때마다 애플리케이션을 자동으로 재시작해준다. 개발자가 소스 수정 후 애플리케이션을 재실행하는 과정을 줄일 수 있으므로 생산성을 향상시킬 수 있다.

[Live Reload]

  • 정적 자원(html, css, js) 수정 시 새로고침 없이 바로 적용할 수 있다.

[Property Defaults]

  • Thymeleaf는 기본적으로 성능을 향상시키기 위해서 캐싱 기능을 사용한다. 하지만 개발하는 과정에서 캐싱 기능을 사용한다면 수정한 소스가 제대로 반영되지 않을 수 있기 때문에 cache의 기본값을 false로 설정할 수 있다.

 

Tmi. 출처의 블로그가 정리를 너무 잘해주셔서 거의 그대로 가져왔다. 

 

 

설정방법

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	implementation 'org.springframework.boot:spring-boot-devtools'
	compileOnly 'org.projectlombok:lombok'
	runtimeOnly 'com.h2database:h2'
	annotationProcessor 'org.projectlombok:lombok'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
  • build.gradle에 implementation 'org.springframework.boot:spring-boot-devtools' 한줄을 추가해준다. 

 

 

 


  • 출처
 

velog

 

velog.io

 

728x90
320x100