Unable to run liquibase update (sevaral cases, just for cassandra only or at all)

I’m writing small PoC, which should use both some standard relational db and cassandra. I have some older code using liquibase 4.27.0, where relational part works just fine. So I’m just using the similar + newer liquibase version.

as shown here, Liquibase for Apache Cassandra - contribute.liquibase.com

I added following dependencies both to maven (from which I build shaded jar, which I then invoke), and also to lib folder of liquibase 4.31.1 for invocations using liquibase skd.

    <dependency>
      <groupId>com.ing.data</groupId>
      <artifactId>cassandra-jdbc-wrapper</artifactId>
      <version>4.13.0</version>
    </dependency>
    <dependency>
      <groupId>org.liquibase.ext</groupId>
      <artifactId>liquibase-cassandra</artifactId>
      <version>4.29.1</version>
    </dependency>

I’m having just this trivial changeset:

   <changeSet dbms="oracle,h2,postgresql,cassandra"  id="createInitialTag" author="mmucha" >
        <tagDatabase tag="@initial"/>
    </changeSet>

and in both cases I’m getting:

Caused by: liquibase.exception.ValidationFailedException: Validation Failed:
     1 changes have validation failures
          cassandra is not a supported DB

Can I get come comment about that? Is this expected or not? What is the support state for cassandra, is it still supported?

I indeed tried also newest version 4.31.1, which does not work either, and even produce much more problems(missing libraries), so I’d like to make sure I cannot stay with 4.24.0. If you know though, how to build jar file with liquibase main entrypoint liquibase.integration.commandline.LiquibaseCommandLine ?


further examination: I found out, that including those maven dependencies does more damage than good. These completely poison dependency tree with conflicts. So this is not the way, I removed the building shaded jar file, and using liquibase 4.31.1 sdk only. This will work with given changeset mentioning cassandra, and will update oracle db. But this cannot be said for cassandra db — liquibase has problems with cassandra jars and to be hones atm I have no idea how to resolve it. I’m again hitting shading issues:

Unexpected error running Liquibase: com/datastax/oss/driver/shaded/guava/common/collect/ImmutableList

  • Caused by: com.datastax.oss.driver.shaded.guava.common.collect.ImmutableList

regardless how I try to avoid all shaded libraries in sdk lib directory. Does anyone know which libraries has to be added so that liquibase can handle cassandra? I tried these:

caffeine-3.2.0.jar
cassandra-jdbc-wrapper-4.15.0.jar
java-driver-core-4.19.0.jar
liquibase-cassandra-4.31.1.1.jar

another approach:
you can download currenct cassandra from Apache Download Mirrors
and take driver from there, but neither of these jars will contain java.lang.ClassNotFoundException: com.datastax.oss.driver.api.core.config.DriverOption
so you will not run liquibase using cassandra-jdbc-wrapper-4.14.0.jar with it.

Thanks!

Let me answer it, if there is another unfortunate soul struggling with this.

If you use cassadra 5, and would like to run liquibase script, using liquibase 4.31.1, you will be missing a lot of jars in lib folder of liquibase. You are instructed to simply provide those, which isn’t that straightforward task, due to various renames/moves etc. I didn’t find anywhere list of jars needed, so I will provide one below. If your versions are different you can use what I used to find all missing: I used ‘spring initializr’ project to init maven project adding all cassadra dependencies. This contained several version conflicts which I cleaned, startup DB, setup liquibase config files, and then ran liquibase multiple times, processsing all missing classes using mvn dependency:tree adding one after another, until liquibase finally completed without crashing.

Complete list of needed jars for cassandra 5 and liquibase 4.31.1 follows, every library on this list was actually needed, liquibase crashed without it. So far I used only tagDatabase changeset, maybe more libraries will arise later on, I will try to keep this list updated(but only here https://stackoverflow.com/questions/79608569/how-to-make-liquibase-work-with-cassandra-5/79609025#79609025):

  • caffeine-3.1.8.jar
  • cassandra-jdbc-wrapper-4.14.0.jar
  • config-1.4.1.jar
  • java-driver-core-shaded-4.19.0.jar
  • java-driver-guava-shaded-4.19.0.jar
  • liquibase-cassandra-4.31.1.jar
  • native-protocol-1.5.1.jar
  • semver4j-5.4.1.jar