[IntelliJ] ์ฝ”๋“œ ๋ณ€๊ฒฝํ•  ๋•Œ๋งˆ๋‹ค ์ž๋™ ์žฌ์‹œ์ž‘ ํ•˜๋Š” ๋ฐฉ๋ฒ• ์ด๋™์› ๋ชจ์Œ์ง‘

2021. 1. 10. 02:17ใ†๐Ÿ†‡ Error&๊ธฐํƒ€

** Intellij ๋ฒ„์ „: 2020.3.1 ๊ธฐ์ค€

** Mac Big Sur 11.0.1

 

์ˆœ์„œ๋Œ€๋กœ ์ง„ํ–‰ํ•˜๋ฉด์„œ ์ ์šฉ๋˜๋Š” ๋ฐ๊นŒ์ง€ ์‹œ๋„ํ•ด๋ณด์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. Springboot๋กœ ๊ด€๋ฆฌ์ž ํŽ˜์ด์ง€๋ฅผ ์ œ์ž‘ํ•˜๋ฉด์„œ html ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด๋‚˜ ์ฝ”๋“œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ์žˆ์„ ๋•Œ๋งˆ๋‹ค ์žฌ์‹œ์ž‘ ํ•˜๋Š” ๊ฒƒ์ด ๋งค์šฐ ๋ถˆํŽธํ•ด์„œ ์„ค์ •์„ ๋‹ค ์ฐพ์•„๋ณด์•˜์Šต๋‹ˆ๋‹ค. ์ €๋Š” ์ฐธ๊ณ ๋กœ 6๋‹จ๊ณ„๊นŒ์ง€ ๊ฐ€์„œ์•ผ ์ ์šฉ์ด ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

1๏ธโƒฃ build.gradle ํŒŒ์ผ

developmentOnly("org.springframework.boot:spring-boot-devtools") ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.

dependencies {
    implementation('org.springframework.boot:spring-boot-starter-web')
    implementation('org.springframework.boot:spring-boot-starter-mustache')
    developmentOnly("org.springframework.boot:spring-boot-devtools")
    
    // ...
}

 

2๏ธโƒฃapplictaion.yml ํŒŒ์ผ

devtools ์„ค์ •์„ ์ถ”๊ฐ€ํ•ด์ค๋‹ˆ๋‹ค.

spring:
  devtools:
    remote:
      restart:
        enabled: true

 

3๏ธโƒฃ Registry ์„ค์ •ํ•˜๊ธฐ

mac ๊ธฐ์ค€ shift ๋‘ ๋ฒˆ ์—ฐ์† ๋ˆŒ๋Ÿฌ์„œ intellj ๊ฒ€์ƒ‰์ฐฝ์„ ์—ฝ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  registry๋ฅผ ๊ฒ€์ƒ‰ํ•ด์„œ complier.automake.allow.when.app.running์„ ์ฒดํฌํ•˜๊ณ  close๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.

 

4๏ธโƒฃPreference ์„ค์ •ํ•˜๊ธฐ

command+, ๋ฅผ ๋ˆŒ๋Ÿฌ์„œ preference ์ฐฝ์„ ์—ด๊ณ  Build,Excution,Deployment > Compiler ์—์„œ Build project Automatically๋ฅผ ์ฒดํฌํ•˜๊ณ  OK๋กœ ๋ฐ˜์˜ํ•ฉ๋‹ˆ๋‹ค.

 

5๏ธโƒฃ ๋ธŒ๋ผ์šฐ์ € ์บ์‹œ๋ฅผ ์‚ญ์ œํ•ด๋ณธ๋‹ค.

ํฌ๋กฌ์ด๋ผ๋ฉด ํ™˜๊ฒฝ์„ค์ • > ๊ฐœ์ธ์ •๋ณด ๋ฐ ๋ณด์•ˆ์—์„œ ์ธํ„ฐ๋„ท ์‚ฌ์šฉ ๊ธฐ๋ก ์‚ญ์ œ๋ฅผ ์„ ํƒํ•˜๊ณ  ์บ์‹œ๋œ ์ด๋ฏธ์ง€์™€ ํŒŒ์ผ์„ ์‚ญ์ œํ•ด์ค๋‹ˆ๋‹ค.

6๏ธโƒฃ์ตœํ›„์˜ ์ˆ˜๋‹จ Edit Configurations

์ด๋ž˜๋„ ์•ˆ๋œ๋‹ค๋ฉด shitf ๋‘ ๋ฒˆ์„ ๋ˆŒ๋Ÿฌ์„œ ๋‹ค์‹œ ๊ฒ€์ƒ‰์ฐฝ์„ ์ผ  ๋’ค edit Configurations๋ฅผ ๊ฒ€์ƒ‰ํ•ด์„œ ๋“ค์–ด๊ฐ„ ๋’ค, On update ๋ž‘ On frame ์˜ต์…˜์„ ๋‘˜ ๋‹ค "Update classes and resources"๋กœ ์ฒดํฌํ•˜๊ณ  intellj๋ฅผ ์žฌ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

 

 

๐Ÿ“š์ฐธ๊ณ : https://elfinlas.github.io/2017/12/25/springbootstaticres/