defaults-file

The --defaults-file global parameter is a case-sensitive string that specifies the filepath Liquibase uses for the file containing configuration properties to apply. By default, the value of this parameter is liquibase.properties.

Uses

If you want to use the default liquibase.properties file to store your configurations, you don't have to specify this parameter.

However, you may want to have multiple defaults files containing different sets of properties or your organization may have a custom naming pattern for configuration files. In these cases, you can use --defaults-file to set a custom name for the file containing your Liquibase properties. You can also use the parameter to specify a remote file location for your Liquibase properties in Amazon S3. For example, using the CLI:

  • Defaults file with a custom name:
  • --defaults-file=my.defaults.file
  • Defaults file with a custom name and path:
  • --defaults-file=/path/to/file/my.defaults.file
  • Defaults file with custom name and path in Amazon S3:
  • --defaults-file=s3://path/to/file/my.defaults.file

For more information on the parameters you need to specify to run Liquibase commands, see Create and Configure a liquibase.properties File.

Syntax

You can set this parameter in the following ways:

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

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.defaultsFile=<string>
Liquibase Environment Variables
LIQUIBASE_DEFAULTS_FILE=<string>

For more information, see Working with Command Parameters.

Related links