忽略应用程序YML中的Spring-boot2和iquibase:config [英] spring-boot 2 and liquibase: config in application yml ignored

查看:46
本文介绍了忽略应用程序YML中的Spring-boot2和iquibase:config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

我有这个日志:

上下文初始化期间遇到异常-取消刷新尝试:org.springframework.beans.factory.BeanCreationException:错误创建名为‘org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration’:的Bean Init方法调用失败;嵌套异常为java.lang.IlLegalStateException:找不到ChangeLog位置:类路径资源[db/changelog/db.changelog-master.yaml](请添加ChangeLog或检查您的Liquibase配置

使用此YAML:

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

  datasource:
    platform: oracle
Liqubase和Spring-Boot2似乎忽略了我的应用程序.yml中的Liqubase部分 有什么想法吗?

我的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=ther.yml

在Springboot1中查找,但不再在Springboot2中查找

在从Spring-boot1迁移到Spring-boot2的过程中,参数spring.config.Location的行为(其中包含类似应用程序的.yml文件)发生了更改。(来源:https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide)

在springboot1中,将spring.config.Location=ther.yml添加到默认文件Applation.yml其他.yml文件

在springboot2中,spring.config.Location将默认的Applation.yml文件替换为其他.yml文件。

要更正,我需要执行以下操作:

spring.config.Location=Applation.yml,ther.yml

这篇关于忽略应用程序YML中的Spring-boot2和iquibase:config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆