Spring Boot + JdbcTemplate 환경설정

손경민·2022년 8월 21일
0

application.yml 설정

spring:
  datasource:
    url: jdbc:postgresql://localhost:5432/jpa_study
    username: jpa_user
    password: jpa_user
    driver-class-name: org.postgresql.Driver

# JdbcTemplate logging level
logging:
  level:
    org:
      springframework:
        jdbc: debug

build.gradle 설정


plugins {
	id 'org.springframework.boot' version '2.6.5'
	id 'io.spring.dependency-management' version '1.0.11.RELEASE'
	id 'java'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
}

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
	implementation 'org.springframework.boot:spring-boot-starter-web'
    // JdbcTemplate
	implementation 'org.springframework.boot:spring-boot-starter-jdbc'
	
	runtimeOnly 'org.postgresql:postgresql'

	testImplementation 'org.springframework.boot:spring-boot-starter-test'

	compileOnly 'org.projectlombok:lombok'
	annotationProcessor 'org.projectlombok:lombok'

	//테스트에서 lombok 사용
	testCompileOnly 'org.projectlombok:lombok'
	testAnnotationProcessor 'org.projectlombok:lombok'
}

tasks.named('test') {
	useJUnitPlatform()
}

0개의 댓글