driver-properties-file

The --driver-properties-file global parameter is a string that specifies a properties file containing database connection properties for the JDBC driver you're using with Liquibase.

Uses

Liquibase is written in Java. To connect it with your database, you need to specify a JDBC (Java Database Connectivity) URL for your database. For example, for a PostgreSQL database:

jdbc:postgresql://localhost:5432/mydatabase

Your JDBC URL can also contain authentication data:

jdbc:postgresql://myuser:mypassword@localhost:5432/mydatabase

Liquibase lets you specify custom values for parameters in the defaults file, which is called liquibase.properties by default. The defaults file can include your JDBC database URL, username, password, and non-authentication settings that alter the behavior of Liquibase.

However, you may not want to store sensitive database connection properties with all your other Liquibase properties. To separate driver-specific properties from other configuration parameters, specify a filepath as the value of --driver-properties-file and store your JDBC connection data there instead of in your defaults file. For example, in the CLI:

--driver-properties-file=path/to/driver/properties/file.properties

The syntax of the driver properties file itself is the same as for the defaults file. For example:

url=jdbc:postgresql://localhost:5432/mydatabase
username=myuser
password=mypassword

Syntax

You can set this parameter in the following ways:

Option Syntax
Liquibase properties file (defaults file)
liquibase.driverPropertiesFile: <string>
Global flow file argument (example)
stages:
  Default:
    actions:
      - type: liquibase
        command: update
        globalArgs: { driver-properties-file: "<string>" }
Global CLI parameter
liquibase
 --driver-properties-file=<string> update
 --changelog-file=example-changelog.xml

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.driverPropertiesFile=<string>
Liquibase Environment Variables
LIQUIBASE_DRIVER_PROPERTIES_FILE=<string>

For more information, see Working with Command Parameters.

Related links