Spring Framework
스프링 gradle database 2개 있는 경우
iIxmont
2019. 1. 10. 16:01
1
2
3
4
5
6
7
8
9
10
11
12 |
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'org.springframework.boot:spring-boot-starter-web'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.postgresql:postgresql'
compileOnly 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
}
|
cs |
이렇게 build.gradle 이 설정되어 있는 경우
postgresql 과 인메모리 db인 h2가 둘 다 들어있다.
이럴때 application.properties 파일에 db설정이 없다면 h2데이터베이스로 실행된다.