1. (Maven 프로젝트 일 경우) pom.xml 파일에 의존성 추가
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.6.10</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
2. application-test.properties 파일에 DB 및 JPA 관련 설정
spring.datasource.driver-class-name = org.h2.Driver
spring.datasource.url = jdbc:h2:mem:test
spring.datasource.username = sa
spring.datasource.password = sa
spring.jpa.database-platform = org.hibernate.dialect.H2Dialect
3. (Intellij) 프로젝트 우클릭 > Maven > Reload project
'Back-end > Spring Boot' 카테고리의 다른 글
Spring Boot+JPA+MySQL 테이블 생성 안될 때 (feat. Maven dependency 추가) (0) | 2023.01.11 |
---|---|
[Eclipse+Spring+Maven] 웹 프로젝트 Import 후 환경 세팅(feat.tomcat server) (0) | 2023.01.11 |