๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐ŸŒฟ Spring

[์ž…๋ฌธ] spring-boot-devtools ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ถ”๊ฐ€ํ•˜๊ธฐ

by nitronium102 2021. 6. 28.

์ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ถ”๊ฐ€ํ•  ๊ฒฝ์šฐ, local์—์„œ ์ปดํŒŒ์ผ๋งŒ ํ•˜๋ฉด ์„œ๋ฒ„ ์žฌ์‹œ์ž‘ ์—†์ด view ํŒŒ์ผ ๋ณ€๊ฒฝ์ด ๊ฐ€๋Šฅํ•˜๋‹ค๊ณ  ํ•ด์„œ ์•Œ์•„๋ณด๊ฒŒ ๋˜์—ˆ๋‹ค. 

 

https://docs.spring.io/spring-boot/docs/1.5.16.RELEASE/reference/html/using-boot-devtools.html

 

20. Developer tools

Applications that use spring-boot-devtools will automatically restart whenever files on the classpath change. This can be a useful feature when working in an IDE as it gives a very fast feedback loop for code changes. By default, any entry on the classpath

docs.spring.io

 

maven๊ณผ gradle ๋‘ ๋ฒ„์ „์ด ์žˆ๋Š”๋ฐ ์ผ๋‹จ ๋‚˜๋Š” gradle์„ ์“ฐ๊ณ  ์žˆ์œผ๋‹ˆ ์ด ๋ฒ„์ „์œผ๋กœ ์‹คํ–‰ํ•œ๋‹ค.

 

01. build.gradle์— ๊ฐ€์„œ depencency์— compileOnly("org.springframework.boot:spring-boot-devtools"์ถ”๊ฐ€

 

02. ctrl+shift+A๋ฅผ ์ž…๋ ฅํ•˜์—ฌ Registry ๊ฒ€์ƒ‰

 

03. compiler.automake.allow.when.app.running ์ฒดํฌ

 

04. File > Settings -> Build > Compiler์— ๋“ค์–ด๊ฐ€์„œ Build Project automatically ์ฒดํฌํ•œ ํ›„ apply

๋!

 

 


4. ๋งŒ์•ฝ ์ •์ƒ์ ์œผ๋กœ ์žฌ์‹œ์ž‘์ด ์•ˆ๋œ๋‹ค๋ฉด, application > Edit Configuration์— ๋“ค์–ด๊ฐ„ ํ›„, Spring Boot์˜ application ์—์„œ On 'Update' action ๊ณผ On frame deactivation ๊ฐ’์„ ๋ชจ๋‘ Update resources ๋กœ ์„ค์ •ํ•˜๋ฉด ๋œ๋‹ค.

๋Œ“๊ธ€