Liquibase with SQLite


I have Liquibase 4.28 installed and I am trying to get it to work with SQLite. I was following this guide: SQLite - but am running into some issues.

When I run liquibase update-sql when specifying my changelog file, I get:

Unexpected error running Liquibase: Could not initialize class org.sqlite.JDBC

  • Caused by: Exception java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory [in thread “main”]

My file is just:

changeLogFile: _main-changelog.xml
url: jdbc:sqlite:test.db

I even tried adding classpath: sqlite-jdbc.jar (copying it from liquibase/internal/lib) but it didn’t change anything.

Really what I want to do is a specify the path to a sqlite db file and run changesets against that. I’m not sure what this example does, if it just creates like a global database for me. Perhaps the global database is the best practice, unsure.

Turns out this is a known issue, the workaround described here: Liquibase and SQLite doesn't work with NoClassDefFoundError: org/slf4j/LoggerFactory error · Issue #5706 · liquibase/liquibase · GitHub worked for me!