개발 성장기/Spring Framework

[SpringBoot] DB 정보없이 서버 띄우기

주난v 2020. 3. 19. 09:45

MongoDB, Redis만을 사용하게 되면서, RDB에 붙을 이유가 사라졌다.

 

그래서 jdbc 설정을 지웠더니...아래와 같은 에러가 발생..

 

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class

 

application.yml에 DB정보가 필수이다.

 

메인클래스에 붙은 @SpringBootApplication > @EnableAutoConfiguration로 인해서 기본 설정이 잡혀 있기 때문이다.

 

 

그래서, 일단은 빈값으로 넣었더니..그래도 동일 문제가 발생하였고,

 

아래와 같이 해결~~

 

spring:

  autoconfigure:
     exclude:
         - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
         - org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration