스프링

 

1 . pom.xml에  spring-boot-devtools 추가

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
			<optional>true</optional>
		</dependency>

 

 

2 . application.properties

다음을 추가

#Springboot auto build
spring.devtools.livereload.enabled=true
spring.devtools.restart.enabled=true

또는

application.yml 에 라이브리로드 추가

 

spring:
  devtools:
    livereload:
      enabled: true
    restart:
      enabled: true

 

 

3. Build project Automaticall 체크

인텔리제이 File -> setting ->

Build,Excution,Deployment > Compiler 에서 Build project Automatically를 체크하고 OK로 반영

 

 

 

4. Allow auto-make to start even if developed application is currently running

 

Shift +shift  클릭후   Running Application   입력

 

 

체크

 

 

 

 

 

 

5.  브라우저에 LiveReload 설치

구글 크롬 웹스토어에서 LiveReload  검색후 설치

 

 

 

 

 

 

 

6.  thymeleaf.cache  false 설정

스프링부트의 Thymeleaf 템플릿 결과는 캐싱하는 것이 디폴트 값이다.

즉, 개발할 때 Thymeleaf를 수정하고 브라우저를 새로고침하면 바로 반영이 되지 않는다.

따라서 개발을 할 때에는 false로 해 주는 것이 재시작  없이 새로고침만으로 반영되게 하는 것이 편하다


application.properties

spring.thymeleaf.cache =false

 

application.yml

spring:
   thymeleaf: 
     cache: false




 

 

 

 

 

 

about author

PHRASE

Level 60  라이트

구슬이 서 말이라도 꿰어야 보배라 , 아무리 좋은 것이라도 쓸모 있게 만들어 놓아야 가치가 있다는 말.

댓글 ( 4)

댓글 남기기

작성

스프링 목록    more