spring-boot application without a datasource

前端 未结 5 1588
粉色の甜心
粉色の甜心 2020-12-08 19:38

Is it possible to create a spring-boot application that has NO datasource? In my case i just need a simple REST app but it seems on start up that there is an attempt to auto

5条回答
  •  我在风中等你
    2020-12-08 19:54

    @Stefan +1 If you are using YAML file for configuration this is how it is

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

    It worked perfectly fine for me.

提交回复
热议问题