Spring/security

[시큐리티] 초기 세팅

라임온조 2023. 3. 9. 10:40

1. 프로젝트 생성

자바 11, 스프링 부트 2.x

spring dev tools, spring data jpa, spring security, lombok, mustache, mysql driver, spring web

2. application.properties

## server
server.address=localhost 
server.port=8080
server.servlet.context-path=/ //연결될 url 설정
// 인코딩 설정
server.servlet.encoding.charset=UTF-8
server.servlet.encoding.enabled=true
server.servlet.encoding.force=true

## my sql
spring.datasource.url=jdbc:mysql://localhost:3306/security_study?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul
spring.datasource.username=root
spring.datasource.password=qlanxl1016
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

## jpa
spring.jpa.show-sql=true
spring.jpa.database=mysql
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl //jpa 관련 네이밍 전략 설정, ddl 작성 시 언더바 안 쓰고 그대로 매핑 해줌