search-path

--search-path is a global argument that specifies a complete list of location(s) to search for files like changelogs. You can specify multiple paths by separating them with commas. --search-path is only used to read files and does not specify files to write to. It is available in Liquibase 4.13+. For more information, see How Liquibase Finds Files: Liquibase Search Path.

Uses

Liquibase uses the paths to files as part of changeset identifiers. It is important for these paths to remain consistent and stable, because they are often included in shared changelog files, even when the physical location of those files may change from machine to machine. The search path is the list of base physical locations where given changelog paths can be found. For each file to look up, Liquibase will check all those locations for the file.

For example, if your referenced file path is db.changelog.xml and your search path is /Users/example/liquibase,/projects/global, Liquibase will look for /Users/example/liquibase/db.changelog.xml and /projects/global/db.changelog.xml.

You can also use --search-path to specify how to find files stored remotely on Amazon AWS S3. For more information, see Use --search-path with S3.

Syntax

You can set this parameter in the following ways:

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

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.searchPath=<string>
Liquibase Environment Variables
LIQUIBASE_SEARCH_PATH=<string>

For more information, see Working with Command Parameters.

Tip: If you use Maven, Ant, Spring Boot, or other integrations, you can set your search path in the default files, such as pom.xml, application.yml, and others. Check the Tools & Integrations documentation for more information.

Related links