Back-end/Spring
[Spring] 스프링부트 + JPA + thymeleaf + Spring Security로 회원가입 + 게시판(수정, 삭제, 등록, 조회, 댓글, 좋아요) + 로그인 구현하기 #2 기본 설정
poopooreum
2024. 8. 29. 19:55
반응형
✏️ Build.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.2'
id 'io.spring.dependency-management' version '1.1.6'
}
group = 'hello'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(22)
}
}
repositories {
mavenCentral()
}
dependencies {
// 템플릿
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
// 웹
implementation 'org.springframework.boot:spring-boot-starter-web'
// jdbc 템플릿, 근데 얘는 밑에 있는 jpa가 알아서 다 처리해줌
//implementation 'org.springframework.boot:spring-boot-starter-jdbc'
// 테스트
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// jpa
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
//롬복
implementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// lombok 테스트 라이브러리
testImplementation 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
// mySQL
runtimeOnly 'com.mysql:mysql-connector-j'
implementation 'com.mysql:mysql-connector-j'
// 레이아웃 적용
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
// Spring security
implementation 'org.springframework.boot:spring-boot-starter-security'
}
tasks.named('test') {
useJUnitPlatform()
}
✏️ application.yml
spring:
datasource:
# MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url:
username:
password:
thymeleaf:
cache: false
prefix: classpath:/templates/
jpa:
database: mysql
database-platform: org.hibernate.dialect.MySQLDialect
show-sql: true
hibernate:
ddl-auto: none
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.MySQLDialect
open-in-view: false
application:
name: hello-spring
logging:
level:
hello.hello_spring: debug
반응형