โ๏ธ ํ๋ก์ ํธ ์์ฑ
Spring Initializer ํ์ด์ง(https://start.spring.io/)์์ ๋ค์๊ณผ ๊ฐ์ด dependency๋ฅผ ์ถ๊ฐํ ํ Generate ๋ฒํผ์ ํด๋ฆญํ๋ค. ํ์ฌ ์๋กญ๊ฒ ์ ๋ฐ์ดํธ ๋์์ง๋ง ๋ณธ์ธ์ Spring Boot 3.2.2 ๋ฒ์ ์ ์ฌ์ฉํ๋ค.
Group๊ณผ Artifact ๋ช ์ ์์ ๋กญ๊ฒ ์ง์ ํด์ฃผ๋ฉด ๋๋ค.
IntelliJ -> Open -> ํ๋ก์ ํธ ํด๋ -> build.gradle์ ํด๋ฆญํ๋ค.
resources ํด๋ ํ์์ application.yml ํ์ผ์ ์์ฑํ๋ค.(application.properties ํ์ผ๋ ๊ฐ๋ฅํ๋ค) Database๋MySQL์ ์ฌ์ฉํ๋ค.
application.yml
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/whatToEat?serverTimezone=UTC&characterEncoding=UTF-8
username: root
password: ${MYSQL_PW}
jpa:
hibernate:
ddl-auto: create
open-in-view: false
generate-ddl: true
properties:
hibernate:
format_sql: true
logging.level:
org:
hibernate:
SQL: DEBUG
type:
descriptor:
sql:
BasicBinder: TRACE
โ๏ธ ์ด๊ธฐ ์ค์
Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors -> Enable annotation processing ์ฒดํฌ๋ฐ์ค ํ์ฑํ -> Apply ๋ฒํผ ํด๋ฆญ
Build, Execution, Deployment -> Build Tools -> Gradle -> Build and run using๊ณผ Run tests using ๋ชจ๋ Gradle์์ IntelliJ IDEA๋ก ๋ฐ๊ฟ์ฃผ๊ธฐ -> Apply ๋ฒํผ ํด๋ฆญ -> OK ๋ฒํผ ํด๋ฆญ
โ๏ธ ์คํ
application ์คํ -> url์ localhost:8080 ์ ๋ ฅ ํ Whitelabel Error Page๊ฐ ๋จ๋ฉด ๋ชจ๋ ์ค๋น๋ ๋๋ฌ๋ค!!!
'Project > ๐ ์ค๋ ๋ญ ๋จน์ง?' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
JWT๋ฅผ ์ด์ฉํ ๋ก๊ทธ์ธ ๊ตฌํ (2) - ์ํฐํฐ ์ค๊ณ (0) | 2024.07.03 |
---|