일단 spring boot 설치 먼저
https://start.spring.io/
여기서 아래와 같이 설정 맞춰주고
GENERATECTRL 버튼 꾸욱
(설정한대로 다운이 안될수도 있다고 하니 나중에 인텔리에서 한버더 확인하는걸로)
의존성 추가하기
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// third party - 비공식
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.0'
implementation group: 'com.auth0', name: 'java-jwt', version: '4.3.0'
runtimeOnly'mysql:mysql-connector-java'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
resources에 생성
server:
port: 포트번호
servlet:
encoding:
charset: UTF-8
enabled: true
force: true
spring:
servlet:
multipart:
max-file-size: 15MB
max-request-size: 50MB
output:
ansi:
enabled: ALWAYS
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:포트번호/스키마이름?serverTimezone=Asia/Seoul&characterEncoding=UTF-8
username: 아이디
password: 비밀번호
thymeleaf:
cache: false
jpa:
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
open-in-view: false
show-sql: true
hibernate:
ddl-auto: create
h2:
console:
enabled: true
jwt:
secret:
key: 시크릿키 설정
sql설정 하기