๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ๋ฐœ ์„ค์ •

IntelliJ(Ultimate) + Thymeleaf Live reload(์‹ค์‹œ๊ฐ„ ๋ฐ˜์˜)์ ์šฉํ•˜๊ธฐ

by ์ฃผ๋ฐœ2 2021. 6. 14.
๋ฐ˜์‘ํ˜•

๐Ÿ“Ž ์ธํ…”๋ฆฌ์ œ์ด + Thymeleaf(ํƒ€์ž„๋ฆฌํ”„) ์—์„œ Live reload ์ ์šฉํ•˜๊ธฐ

์•ˆ๋…•ํ•˜์„ธ์š”, ์ด๋ฒˆ ์‹œ๊ฐ„์—์„œ๋Š” ์ธํ…”๋ฆฌ์ œ์ด + ์Šคํ”„๋ง๋ถ€ํŠธ + ํƒ€์ž„๋ฆฌํ”„๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ, ๊ฐ„๋‹จํ•œ html ํŒŒ์ผ์„ ๋ณ€๊ฒฝํ•œ ํ›„ ์žฌ์‹คํ–‰ ์—†์ด ์ƒˆ๋กœ๊ณ ์นจ์„ ํ†ตํ•ด ๋ฐ”๋กœ๋ฐ”๋กœ ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋„๋ก ์„ค์ •ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

(๋งค ์šฐ ๊ฐ„ ๋‹จ)

 

 

1. ์„ค์ • ํŒŒ์ผ(application.xml) ์ ์šฉํ•˜๊ธฐ

spring.thymeleaf.cache=false

Thymeleaf๋„ JSP์ฒ˜๋Ÿผ ์„œ๋ฒ„์—์„œ ๊ฒฐ๊ณผ๋ฅผ ๋งŒ๋“ค์–ด ๋ธŒ๋ผ์šฐ์ €(ํด๋ผ์ด์–ธํŠธ)๋กœ ์ „์†ก์„ ํ•ฉ๋‹ˆ๋‹ค.

์œ„ cache=false ์„ค์ •์€ ์ด๋ฏธ ์ƒ์„ฑ๋œ ๊ฒฐ๊ณผ๋ฅผ ์„œ๋ฒ„์—์„œ ๊ณ„์† ๋ณด๊ด€ํ•  ๊ฒƒ์ธ์ง€์— ๋Œ€ํ•œ ์„ค์ •์ž…๋‹ˆ๋‹ค.

Thymeleaf ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜๊ณ  ์ €์žฅํ•œ ํ›„ ๋ธŒ๋ผ์šฐ์ €์—์„œ ๋ณ€๊ฒฝ๋œ ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•œ ์„ค์ •์ž…๋‹ˆ๋‹ค.

 

 

 

2. Configuration ์„ค์ •

์ธํ…”๋ฆฌ์ œ์ด ์ƒ๋‹จ Run > Edit Configurations ํด๋ฆญ

(ํ˜น์€ ์•„๋ž˜ ์‚ฌ์ง„์˜ Edit Configurations... ํด๋ฆญ)

์ €๋Š” ํ˜„์žฌ ์ธํ…”๋ฆฌ์ œ์ด์˜ Ultimate(์œ ๋ฃŒ๋ฒ„์ „)์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด์„œ ์œ„์™€ ๊ฐ™์ด ์ ์šฉ์„ ํ•ด์ฃผ์—ˆ๋Š”๋ฐ์š”, Community(๋ฌด๋ฃŒ๋ฒ„์ „)์—๋„ ์œ„์™€ ๊ฐ™์€ ์„ค์ •์ด ์žˆ๋Š”์ง€๋Š” ํ™•์ธ์„ ํ•ด๋ณด์ง€์•Š์•˜์Šต๋‹ˆ๋‹ค! ๐Ÿ˜‚

 

 

 

 

์„ค์ • ํŒŒ์ผ์—์„œ On 'Update' action, On frame deactivation ๋ถ€๋ถ„์„ Update classes and resources ๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.

 

 

 

์œ„ ์ž‘์—…์„ ๋๋‚œ ๋’ค ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์‹คํ–‰ํ•˜๊ณ , html ํŒŒ์ผ์„ ์ˆ˜์ •ํ•œ ํ›„ ์žฌ๊ธฐ๋™์—†์ด ์›น์‚ฌ์ดํŠธ์—์„œ ์ƒˆ๋กœ๊ณ ์นจ์„ ํ†ตํ•ด ๋ฐ”๋กœ๋ฐ”๋กœ ๋ฐ˜์˜๋œ ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ™˜๊ฒฝ์— ๋”ฐ๋ผ ๋‹ค๋ฅด๊ฒ ์ง€๋งŒ, ๋ช‡ ์ดˆ์ •๋„๋Š” ๊ฑธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค !

 

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€