티스토리 뷰

반응형

✏️  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
반응형
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함