headless parameter

The headless parameter is a Boolean value that allows you to force Liquibase to run without access to the console for input and output. By default, the value is false.

Uses

You can use the headless parameter when you run Liquibase in automation or with CI/CD tools. For example, when running commands, you may need to skip the prompt for Liquibase Hub Auto-Registration and Report Links to continue the automation. In this case, you can set the headless parameter to true to run commands without interaction.

If you run Liquibase in containers, the headless parameter will prevent Liquibase from trying to access the display, keyboard, or mouse.

Setting the headless parameter

You can set the headless parameter by choosing one of the following ways:

headless as a Java system property

You can set the headless parameter as a Java system property from your command line:

java -Dliquibase.headless=<true|false>

You can also set it with the JAVA_OPTS Environment Variable.

The syntax for Mac/Linux:

JAVA_OPTS=-Dliquibase.headless=<true|false>

The syntax for Windows, which requires the set command:

set JAVA_OPTS=-Dliquibase.headless=<true|false>

headless in the liquibase.properties file:

You can set the headless parameter by adding the following to your liquibase.properties file:

liquibase.headless: <true|false>

headless as a CLI global parameter

You can use headless as a global parameter in your command line with a Liquibase command, such as update:

liquibase --headless=<true|false> update --changelog-file=dbchangelog.xml

headless as an environment variable

If you use Liquibase Pro, you can set headless as an environment variable.

The syntax for Mac/Linux:

LIQUIBASE_HEADLESS=<true|false>

The syntax for Windows, which requires the set command:

set LIQUIBASE_HEADLESS=<true|false>

Note: The commands shown above only apply to the current shell. If you need to pass an environment variable to a child process without affecting the parent process, you can use the export command on Mac/Linux or the setx command on Windows.