spring-boot 2 和 liquibase:忽略应用程序 yml 中的配置

spring-boot 2 and liquibase: config in application yml ignored

我尝试将一个应用程序从 spring-boot1 迁移到 spring-boot 2,但是我在 spring-boot 部分遇到了很多困难:

我有这个日志:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot find changelog location: class path resource [db/changelog/db.changelog-master.yaml] (please add changelog or check your Liquibase configurati

使用这个 yaml:

spring:
  application:
    name: xxx
  jpa:
    generate-ddl: false
  liquibase:
      change-log: "classpath:/liquibase/xxx-db/db.changelog.json"

  datasource:
    platform: oracle

liquibase 和 spring-boot 2 似乎忽略了我的 application.yml 的 liquibase 部分 有什么想法吗?

我的 pom:

    <spring-boot.version>2.0.3.RELEASE</spring-boot.version>
    <spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
    <liquibase.version>3.4.2</liquibase.version>

所以,我发现:

我正在使用这个:

spring.config.location=other.yml

在 springboot1 中可以找到,但在 springboot2

中就不行了

在从 spring-boot 1 迁移到 spring-boot 2 期间,参数 spring.config.location 的行为(application.yml- 类文件所在的位置)有零钱。 (来源:https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide

在springboot1中,spring.config.location=other.yml添加到默认文件application.yml other.yml文件

在 springboot2 中,spring.config.location 将默认的 application.yml 文件替换为 other.yml 文件。

要更正,我需要这样做:

spring.config.location=application.yml,other.yml