【问题标题】:Executing liquibase to generate a changeLogFile in gradle generates error在gradle中执行liquibase生成changeLogFile会报错
【发布时间】:2019-12-16 04:55:10
【问题描述】:

我有一个使用 liquibase-core 3.7.0 的 Spring Boot gradle 项目,大致按照以下答案:Unable to generate difference from liquibase gradle plugin

使用 Java 11 并运行任务 liquibaseDiffChangelog 我现在收到以下错误:

Starting Liquibase at Thu, 08 Aug 2019 13:52:35 BST (version 3.7.0 built at 2019-07-16 02:32:57) Unexpected error running Liquibase: class liquibase.command.DiffToChangeLogCommand cannot be cast to class liquibase.command.core.DiffToChangeLogCommand (liquibase.command.DiffToChangeLogCommand and liquibase.command.core.DiffToChangeLogCommand are in unnamed module of loader 'app') java.lang.ClassCastException: class liquibase.command.DiffToChangeLogCommand cannot be cast to class liquibase.command.core.DiffToChangeLogCommand (liquibase.command.DiffToChangeLogCommand and liquibase.command.core.DiffToChangeLogCommand are in unnamed module of loader 'app') at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:226) at liquibase.integration.commandline.Main.doMigration(Main.java:1011) at liquibase.integration.commandline.Main.run(Main.java:192) at liquibase.integration.commandline.Main.main(Main.java:130)

【问题讨论】:

    标签: gradle liquibase java-11


    【解决方案1】:

    这是由您的构建中的版本冲突引起的。

    您需要将 liquibase 版本降级到 3.5.5,因为之后的版本引入了重大更改。

    一种方法是在你的 gradle 配置中强制设置

    configurations.all {
      resolutionStrategy {
        force 'org.liquibase:liquibase-core:3.5.5'
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2020-06-21
      • 2020-09-25
      • 2017-08-10
      • 2016-07-05
      • 2020-04-28
      • 2021-12-21
      • 1970-01-01
      • 2016-06-13
      • 2023-03-24
      相关资源
      最近更新 更多