Liquibase® version 3.8.5 is now available! Get it for free.
2018 XML Announcement
News All Previous Posts >>

Subscribe for email updates

- and/or -

Creating and Configuring a liquibase.properties File

Creating a liquibase.properties file allows you to store properties that don’t change often in a liquibase.properties file. You can also use parameters to specify your database connection information so Liquibase can access your database and save you the trouble of passing along command line arguments.

Creating the File

To create a liquibase.properties file, generate a new text file in your project Liquibase directory and name it liquibase.properties.

Note: The file can also be named something other than liquibase.properties and/or be in a completely different directory by using the –defaultsFile parameter during runtime. To learn more please see Liquibase Command Line.

Parameters

The most common properties that you might set in the liquibase.properties are listed below. Any parameter that could be specified on the command line can also be specified in the properties file. If a parameter is specified in both the properties file and the command line, the command line value will override the value in the file.

Parameter Definition
changeLogFile The path for your changelog file
driver The driver class name for your source database
url The primary database when doing an update, or the source database for performing comparisons.
username The username for your source database.
password The password for your source database.
referenceDriver The driver class name for your target database.
referenceUrl The database you want to use to compare to your source database. Also known as your target.
referenceUsername The username for your target database.
referencePassword The password for your target database.
liquibaseProLicenseKey Your Liquibase Pro license key (If you have one).
classpath The path for your database driver
parameter.[parameter name] Define global change log parameter. E.g. parameter.table.name: tableA

Different commands require different parameter information to work. For more information on parameter requirements, search the Liquibase Command topics in the knowledge base.

liquibase.properties File Example

changeLogFile: ../path/to/file/dbchangelog.xml
driver: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:@192.168.0.22:1521/orcl
username: PRO
password: password
referenceDriver: oracle.jdbc.OracleDriver
referenceUrl: jdbc:oracle:thin:@192.168.0.22:1521/orcl
referencePassword: password
liquibaseProLicenseKey: aeioufakekey32aeioufakekey785463214
classpath: ../path/to/file/ojdbc6-11.2.0.3.0.jar

Advanced configuration options

Parameter Definition
includeCatalogInSpecification boolean Should Liquibase include the catalog name when determining equality?
convertDataTypes boolean Should Liquibase convert to/from STANDARD data types. Applies to both snapshot and update commands. Default= true

See Also