๐Ÿง‘โ€๐Ÿ’ป VS Code์—์„œ Spring Boot ์„ค์ •ํ•˜๊ธฐ

J_m2nยท2024๋…„ 1์›” 24์ผ
0



์ธํ…”๋ฆฌ์ œ์ด๋ฅผ ์ž˜ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์—ˆ๋Š”๋ฐ Trial ๋ฒ„์ „ ๊ธฐ๊ฐ„์ด ๋‹ค ๋ผ์„œ..
๊ทธ๋ ‡๋‹ค๊ณ  ๊ฒฐ์ œ๋ฅผ ํ•˜์ž๋‹ˆ ๋ฐฑ์ˆ˜์—๊ฒŒ ๊ฝค๋‚˜ ํฐ ๋ˆ์ด์˜€๋‹ค..ใ… ใ… 

๊ทธ๋ž˜์„œ ๋ฐฑ์ค€ ํ’€์ด์šฉ์œผ๋กœ ์“ฐ๋˜ VS Code์—์„œ Spring Boot๋ฅผ ์‚ฌ์šฉํ•ด๋ณด๊ธฐ๋กœ ๊ฒฐ์ •!


๋ฌธ์ œ๋Š” ์ธํ…”๋ฆฌ์ œ์ด์™€ ๋˜ ๋‹ฌ๋ผ์„œ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ๋ถ€ํ„ฐ ๊ณ ๋‚œ์ด์˜€๋‹ค.

๊ทธ๋ž˜์„œ ์•ž์œผ๋กœ๋„ ์ž์ฃผ ๋งŒ๋“ค ๊ฒƒ ๊ฐ™์œผ๋‹ˆ ์ด๋ ‡๊ฒŒ ๊ธ€์„ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.



VS Code์—์„œ Spring Boot ์„ค์ •ํ•˜๊ธฐ

  1. ์ƒˆ๋กœ์šด ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ
  2. Spring Initializr : Specify Spring Boot version ์„ ํƒ
  3. Spring ๋ฒ„์ „ ์„ ํƒ
  4. ๊ฐœ๋ฐœ ์–ธ์–ด ์„ ํƒ
  5. Group Id ์ •ํ•˜๊ธฐ
  6. Artifact Id ์ •ํ•˜๊ธฐ
  7. Jar / War ์„ ํƒ
  8. JDK ๋ฒ„์ „ ์„ ํƒ
  9. dependency (์˜์กด์„ฑ) ์„ ํƒ

1. ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ ์„ค์น˜ ํ›„ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

Ctrl + Shift + X๋กœ ํ™•์žฅ ๋งˆ์ผ“ํ”Œ๋ ˆ์ด์Šค๋ฅผ ์—ด์–ด์ค๋‹ˆ๋‹ค.
(Mac์—์„œ๋Š” Command + Shift + X)


Spring Initializr Java Support๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

(์•„๋‹ˆ๋ฉด ์œ„์— 3๊ฐœ ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•ด์„œ ์„ค์น˜ํ•ด๋„ ๋œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.)



2. Spring Initializr : Specify Spring Boot version ์„ ํƒ

Ctrl + Shift + P๋ฅผ ๋ˆ„๋ฅด๊ณ  Spring Initializr : Specify Spring Boot version๋ฅผ ๊ฒ€์ƒ‰ํ•ด์„œ ์„ ํƒํ•ด์ค๋‹ˆ๋‹ค. (Mac์—์„œ๋Š” Command + Shift + P)


์ €๋Š” Gradle Project๋กœ ์„ ํƒํ–ˆ์Šต๋‹ˆ๋‹ค.



3. Spring ๋ฒ„์ „ ์„ ํƒ

์ €๋Š” 3.2.2 ๋ฒ„์ „์œผ๋กœ ์„ ํƒํ–ˆ์Šต๋‹ˆ๋‹ค.



4. ๊ฐœ๋ฐœ ์–ธ์–ด ์„ ํƒ


Java, Kotlin, Groovy ์ค‘์— ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
์ €๋Š” Java๋กœ ํ–ˆ์Šต๋‹ˆ๋‹ค.



5. Group Id ์ •ํ•˜๊ธฐ



6. Artifact Id ์ •ํ•˜๊ธฐ



7. Jar / War ์„ ํƒํ•˜๊ธฐ


์ €๋Š” Jar์— ์ต์ˆ™ํ•ด์„œ Jar๋กœ ์„ ํƒํ–ˆ์Šต๋‹ˆ๋‹ค.



8. JDK ๋ฒ„์ „ ์„ ํƒ


๋ณธ์ธ ์ปดํ“จํ„ฐ์— ๊น”๋ ค์žˆ๋Š” jdk๋ฅผ ์„ ํƒํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
์ €๋Š” JDK 17์„ ์“ฐ๊ณ  ์žˆ์–ด์„œ 17์„ ์„ ํƒํ–ˆ์Šต๋‹ˆ๋‹ค.



9. dependency (์˜์กด์„ฑ) ์ถ”๊ฐ€ํ•˜๊ธฐ


Spring Boot DevTools, Lombok, Spring Web, Spring Data JPA, Spring Configuration Processor, Mustache ๋Š” ๊ณตํ†ต์ ์œผ๋กœ ์„ ํƒํ•˜์…”์•ผ ํ•˜๋Š” ๊ฒƒ ๊ฐ™๊ณ 

๋ณธ์ธ์ด ์‚ฌ์šฉํ•˜์‹œ๋Š” DB์— ๋”ฐ๋ผ MySQL, H2, Maria ๋“ฑ ์„ ํƒํ•˜์‹œ๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

profile
์ฝ”๋”ฉ ์ดˆ์งœ์ž…๋‹ˆ๋‹ค

0๊ฐœ์˜ ๋Œ“๊ธ€