[Spring] devtools ์„ค์ •(intellij)

devtools ์„ค์ •

๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ์ž๋™์œผ๋กœ ๋นŒ๋“œ ํ•ด์ฃผ๋Š” devtools๋ฅผ gradle ํ”„๋กœ์ ํŠธ์—์„œ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ์„ค์ •์„ ์•Œ์•„๋ณด์ž.

build.gradle ์˜์กด๊ด€๊ณ„ ์„ค์ •

dependencies {
  //...
  developmentOnly 'org.springframework.boot:spring-boot-devtools'
  //...
}

build.gradle์— ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜์กด๊ด€๊ณ„๋ฅผ ์„ค์ •ํ•œ๋‹ค.

setting -> Build, Execution, Deployment -> Compiler

1

ํ•ด๋‹น ๋ถ€๋ถ„์— ๋“ค์–ด๊ฐ€์„œ Build project automatically๋ฅผ ์ฒดํฌํ•ด ์ค€๋‹ค.

Registry ์„ค์ •

ctrl + shift + alt + / ํ›„ registry๋กœ ๋“ค์–ด๊ฐ€์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ•ญ๋ชฉ์„ ์ฒดํฌํ•œ๋‹ค.

2 compiler.automake.allow.when.app.running ํ•ญ๋ชฉ์ด๋‹ค.

application.yml ์„ค์ •

application.yml์— ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์„ค์ •์„ ์ถ”๊ฐ€ํ•œ๋‹ค.

spring:
  devtools:
    livereload:
      enabled: true
  freemarker:
    cache: false

application.property๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ฌธ๋ฒ•์— ๋งž๊ฒŒ ๊ณ ์ณ์„œ ์ถ”๊ฐ€ํ•œ๋‹ค.

intellij ์žฌ์‹œ์ž‘

์žฌ์‹œ์ž‘ ํ›„ devtool์ด ์ž‘๋™ํ•จ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.