0

I have a spring boot gradle project using liquibase-core 3.7.0 roughly as per the answer in: Unable to generate difference from liquibase gradle plugin

Using Java 11 and running the task liquibaseDiffChangelog I now get the following error:

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)

Andy Cribbens
  • 1,370
  • 2
  • 11
  • 22

1 Answers1

0

This is caused by a version conflict in your build.

You need to downgrade your liquibase version to 3.5.5 as the versions after that introduced breaking changes.

One way is to force things in your gradle config

configurations.all {
  resolutionStrategy {
    force 'org.liquibase:liquibase-core:3.5.5'
  }
}
allkenang
  • 1,511
  • 15
  • 12