๊ด€๋ฆฌ ๋ฉ”๋‰ด

Coding Planet

[์Šคํ”„๋ง ์ž…๋ฌธ] 1. ํ”„๋กœ์ ํŠธ ํ™˜๊ฒฝ ์„ค์ • (update! Spring Boot 3.x ์‹œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ ๊ฒฝ์šฐ) ๋ณธ๋ฌธ

๐ŸŒฑSPRING

[์Šคํ”„๋ง ์ž…๋ฌธ] 1. ํ”„๋กœ์ ํŠธ ํ™˜๊ฒฝ ์„ค์ • (update! Spring Boot 3.x ์‹œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ ๊ฒฝ์šฐ)

jhj.sharon 2023. 3. 23. 02:47
๋ฐ˜์‘ํ˜•

 

 

์ธํ”„๋Ÿฐ ๊น€์˜ํ•œ ์„ ์ƒ๋‹˜์˜ ๋ฌด๋ฃŒ ๊ฐ•์˜ '์Šคํ”„๋ง ์ž…๋ฌธ - ์ฝ”๋“œ๋กœ ๋ฐฐ์šฐ๋Š” ์Šคํ”„๋ง ๋ถ€ํŠธ, ์›น MVC, DB ์ ‘๊ทผ ๊ธฐ์ˆ '์„
๊ฐœ์ธ์ ์ธ ๊ณต๋ถ€๋ฅผ ์œ„ํ•ด ์ •๋ฆฌํ•˜์˜€๋‹ค.

 

 

์‚ฌ์ „ ์ค€๋น„๋ฌผ : Java 11, IDE: intelliJ or Eclipse

 

 

1. start.spring.io์ ‘์† ํ›„ ์•„๋ž˜์™€ ๊ฐ™์ด ๋‹ค์šด๋กœ๋“œ

  • ๋‹ค์šด๋กœ๋“œํ•œ ํŒŒ์ผ์„ ์‹คํ–‰์‹œ์ผœ ์„ค์น˜ํ•œ๋‹ค.
  • ์›Œํฌ์ŠคํŽ˜์ด์Šค๋ฅผ ๋งŒ๋“ค๊ณ  ํ•ด๋‹น๊ฒฝ๋กœ๋กœ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์„ค์ •ํ•œ๋‹ค.

 

2. IntelliJ์—์„œ ์•ž์„œ Spring์„ ์„ค์น˜ํ•œ workspace๋กœ ๊ฒฝ๋กœ๋กœ ๋“ค์–ด๊ฐ€์„œ ํŒŒ์ผ์„ ์—ฐ๋‹ค.

 

 

3. ์•„๋ž˜ ์‚ฌ์ง„ ๊ฒฝ๋กœ๋ฅผ ํ™•์ธํ•ด์„œ HelloSpringApplication์„ ํด๋ฆญํ•ด main ๋ฉ”์„œ๋“œ๋ฅผ ์‹คํ–‰์‹œํ‚จ๋‹ค 

  • ์‹œ๊ฐ„์ด ๋‹ค์†Œ ์†Œ์š”๋œ๋‹ค!
  • ์ „์ฒด ์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋˜์ง€ ์•Š๊ณ  ์„ค์น˜ ์‹œ๊ฐ„์ด ๊ธธ์–ด์งˆ ๊ฒฝ์šฐ์— ๋ธŒ๋ผ์šฐ์ €์— localhost:8080์„ ์ผœ์„œ ์„ค์น˜๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

 

* ์•„๋ž˜์™€ ๊ฐ™์ด ๋‚˜์˜ค๋ฉด ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰๋œ ๊ฒƒ์ด๋‹ˆ๊นŒ ์‹คํ–‰์ด ์ง€์†๋˜๋„ ๊ดœ์ฐฎ๋‹ค

-> ๋‚˜๋Š” ํ•œ์ฐธ ๊ธฐ๋‹ค๋ฆผ....๐Ÿ˜…

 

4. IntelliJ์—์„œ Gradle์„ ํ†ตํ•ด run์„ ํ•  ๊ฒฝ์šฐ ๋Š๋ ค์ง€๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์€๋ฐ ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ •ํ•ด๋‘๋ฉด ์†๋„๊ฐ€ ๋นจ๋ผ์ง„๋‹ค.

  • ๊น€์˜ํ•œ ์„ ์ƒ๋‹˜ ๊ฐ•์˜์—์„œ๋Š” intelliJ IDEA๋ผ๋Š” ์ƒ๋‹จ ๋ฉ”๋‰ด๋ฅผ ํ†ตํ•ด preferance ๋ฅผ ์ ‘๊ทผํ•˜๋Š”๋ฐ ๋‚˜๋Š” ๋ฌด๋ฃŒ๋ฒ„์ „์ด๋ผ ๊ทธ๋Ÿฐ์ง€, ์‹œ๊ฐ„์ด ํ˜๋Ÿฌ์„œ intelliJ ์ธํ„ฐํŽ˜์ด์Šค๊ฐ€ ๋ฐ”๋€Œ์–ด์„œ ๊ทธ๋Ÿฐ์ง€ ํ•ด๋‹น ๋ฉ”๋‰ด๊ฐ€ ์—†์—ˆ๋‹ค.
  • Ctrl + Alt + S ๋‹จ์ถ•ํ‚ค๋กœ Setting์— ๋“ค์–ด๊ฐ€์„œ ๊ฒ€์ƒ‰ํ•˜๋ฉด ๋œ๋‹ค.

 

 

 

 

๋!

 

 

 

** ์ตœ๊ทผ Spring Boot ๋ฒ„์ „์ด ์•„๋ž˜์™€ ๊ฐ™์ด ์—…๋ฐ์ดํŠธ ๋ฌ๋‹ค. ์ด ๋•Œ๋ฌธ์— ์•„๋ž˜์™€ ๊ฐ™์ด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.

   (2023-07-27)

 

  • No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.2 was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.2.1' but:

-> Spring Boot 3.0 ์ด์ƒ ๋ถ€ํ„ฐ๋Š” Java 17๋ถ€ํ„ฐ ์ง€์›๋œ๋‹ค. ๋”ฐ๋ผ์„œ JAVA 8, 11 ๋“ฑ์„ ์‚ฌ์šฉํ•˜๋˜ ์œ ์ €๋“ค์€ ์Šคํ”„๋ง๋ถ€ํŠธ ์‹คํ–‰์‹œ ์œ„์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค. ๋”ฐ๋ผ์„œ  Java 17๋ฅผ ์„ค์น˜ํ•˜๋˜์ง€, ์Šคํ”„๋ง ๋ถ€ํŠธ๋ฅผ ๋‹ค์šด๊ทธ๋ ˆ์ด๋“œ ํ•ด์•ผํ•œ๋‹ค.

 

Spring.io ์„ค์น˜ ํŽ˜์ด์ง€ ์˜ต์…˜

๋ฐ˜์‘ํ˜•
Comments