본문 바로가기
오류노트

스프링 부트에서 h2database Server 클래스 불러오지 못할때

by 어컴띵 2021. 4. 16.

h2database를 적용하던중 Server.createServer 메서드를 추가할때 h2database의 Server클래스를 import 못할때가 있다. 이문제는 gradle에 의존성 설정을 runtimeOnly로 설정했기 때문이다. 이부분을 compile로 수정하고 다시 Server클래스를 사용하면 import가 되는걸 볼수 잇다.

runtimeOnly 'com.h2database:h2'

를 compile로 수정한다.

compile 'com.h2database:h2'