본문 바로가기
Spring

[SpringBoot] spring-boot-devtools 추가하여 서버 재시작 없이 View 파일 변경 확인하기

by 박성민 2021. 4. 28.

스프링부트를 이용하여 웹 개발을 하다보면 매우 자주 view 파일을 수정하게 된다.
수정할 때마다 서버를 재시작해야 변경된 내용이 반영되기 때문에 매우매우매우 시간낭비이고 짜증난다.
하지만 spring-boot-devtools 이놈을 추가하면 서버 재시작 없이 View 파일 변경이 가능하다.

의존성 추가

저는 maven을 사용하기 때문에 pom.xml에 추가했습니다.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
</dependency>

테스트

  1. 현재 화면

1

  1. html 파일 수정
<body>
헬로우~~~~~
<a href="/hello">hello</a>
  1. Build -> Recompile 'html파일명'

2

  1. 브라우저 새로고침

3

와우!

댓글