Liquibase.properties file inconsistent parameter syntax?!

I’m evaluating Liquibase OSS 4.32.0. Installed it on a RHEL8 Linux VM. Got it working against a MySQL database with the latest mysql Connector/J JDBC driver.

BUT before getting it working I hit my head against a wall with the following hurdle:

See example In the liquibase.properties file:
When I specify liquibase.driver and liquibase.classpath parameters, I get:
ERROR: Exception Details
ERROR: Exception Primary Class: RuntimeException
ERROR: Exception Primary Reason: Cannot find database driver: com.mysql.cj.jdbc.Driver
ERROR: Exception Primary Source: 4.32.0

Unexpected error running Liquibase: Cannot find database driver: com.mysql.cj.jdbc.Driver

BUT, when I remove the “liquibase.” prefix from the driver and classpath parameters, then it works successfully. See excerpt below from my liquibase.properties file:

NOTE: Tried embedding these two parameters for specifying the mysql jar-file driver with liquibase prefix and didnt work!..

#liquibase.driver=com.mysql.cj.jdbc.Driver
#liquibase.classpath=/usr/share/java/mysql-connector-j.jar

These two work WITHOUT the liquibase. prefix!!..

driver=com.mysql.cj.jdbc.Driver
classpath=/usr/share/java/mysql-connector-j.jar

This looks like a BUG. Please advise?!

Welcome to the forums @ekalwa!

The # character indicates a comment in a properties file. Did you try running it without then # characters preceding the liquibase.* configuration keys?

The reason that driver and classpath work with the liquibase. prefix is backwards compatibility. Those used to be the standard keys to specify those value before we made it more specific in the 4.0 release (and all releases after).

Of course, I know the # character starts a comment line! I had to comment out those lines because the syntax doesn’t work with the “liquibase.” prefix for those two parameters!!!

1 Like