Maven checks run

Last updated: July 14, 2025

The checks.run goal executes Liquibase policy checks using the checks settings file and the changelog file you specify. To maintain or improve the quality of your database changes, get started with policy checks with these articles:

  • Policy checks.

  • Library of policy checks.

If you need to customize policy checks, use the Liquibase CLI, which supports interactive mode for copy, customize, delete, disable, enable, reset, and bulk-set.

Uses

Use the checks.run goal to run static and dynamic checks against the specified changelog in XML, SQL, YAML, or JSON format. Liquibase reports the outcome of the checks to STDOUT. The return code helps you detect non-compliant changes and stop deployment jobs in automation.

If your files are not stored in the Liquibase working directory, specify the relative path to them. Check How Liquibase Finds Files: Liquibase Search Path for more details.

Note: To see the list of available checks, run mvn liquibase:checks.show.

Maven configuration

You can configure Liquibase Maven in multiple ways. You can pass arguments like <changeLogFile> in Maven directly in your pom.xml file, in a liquibase.properties file referenced in your POM, as environment variables, or as JVM system properties. To learn about each file's syntax, see Maven Properties.

Tip: For more information about the Maven configuration, see Configuring Maven.

Checks settings file configuration

When you start using the policy checks functionality by running any checks goal, Liquibase identifies the need for a checks settings file:

  • Enter Y at runtime to create the default checks settings file named liquibase.checks-settings.conf in the Liquibase working directory.

  • To use the in-memory file while running checks.run or checks.show, enter N at runtime. Other commands require a checks settings file to save the changes for checks.

  • To use a checks settings file customized for a specific environment or project, pass it with the checks settings file parameter. If you do not include the parameter, Liquibase uses the in-memory file or default settings file –liquibase.checks-settings.conf.

Running the checks.run Maven goal

Running the checks.run goal requires you to have a Maven project implemented with the changelog parameter specified. To run the goal, enter the following at your command prompt:

mvn liquibase:checks.run

Maven checks run configuration properties

Maven checks run configuration properties

Property

Definition

CLI: -Dliquibase.checksSettingsFile

Property in the pom.xml file: <checksSettingsFile>path/to/checks-settings.conf</checksSettingsFile>

Environment variable: LIQUIBASE_COMMAND_CHECKS_RUN_CHECKS_SETTINGS_FILE

This parameter specifies the needed checks settings file to work with goals.

Set the checksSettingsFile parameter to the relative path of the checks settings file which you want to use or modify.

For more information, see Use the Checks Settings Configuration File.

CLI: -Dliquibase.changeLogFile

Property in the pom.xml file: your changelog file

Environment variable: LIQUIBASE_COMMAND_CHECKS_RUN_CHANGELOG_FILE

The changelog file against which you execute checks when running the checks.run goal.

Maven checks run output

When successful, the checks.run Maven goal produces the following output:

Executing Policy Checks against dbchangelog.xml Executing all checks because a valid Liquibase Pro license was found! [INFO] Check settings configuration file located at '/liquibase-maven/liquibase.checks-settings.conf'. Checks completed validation of the changelog and found the following issues: Changeset ID: 1 Changeset Filepath: dbchangelog.xml Check Name: Changesets Must Have a Label Assigned (ChangesetLabelCheck) Check Severity: INFO (Return code: 0) Message: Liquibase recommends that labels be assigned to each changeset to provide better deployment control and to enhance traceability of efforts across changesets. Review the changeset indicated and consider adding a label to it. Changeset ID: 1 Changeset Filepath: dbchangelog.xml Check Name: Changesets Must Have a Context Assigned (ChangesetContextCheck) Check Severity: INFO (Return code: 0) Message: Liquibase recommends that contexts be assigned to each changeset to provide better deployment control and to enhance traceability of efforts across changesets. Review the changeset indicated and consider adding a context to it. Changeset ID: 1 Changeset Filepath: dbchangelog.xml Check Name: Changesets Must Have a Comment Assigned (ChangesetCommentCheck) Check Severity: INFO (Return code: 0) Message: Liquibase recommends that authors include comments about the purpose and impact of a changeset in <comment< elements to prevent the development of undocumented or siloed knowledge and ensure that the purpose of a given changeset is easily understood by other people who use this changelog. Changeset ID: 2 Changeset Filepath: dbchangelog.xml Check Name: Rollback Required for Changeset (RollbackRequired) Check Severity: INFO (Return code: 0) Message: Liquibase recommends writing explicit rollback code for a changeset, where possible. While Liquibase does generate automatic rollback code for many changetypes, this check triggers when rollback code is not included. Changeset ID: 2 Changeset Filepath: dbchangelog.xml Check Name: Changesets Must Have a Label Assigned (ChangesetLabelCheck) Check Severity: INFO (Return code: 0) Message: Liquibase recommends that labels be assigned to each changeset to provide better deployment control and to enhance traceability of efforts across changesets. Review the changeset indicated and consider adding a label to it. Changeset ID: 2 Changeset Filepath: dbchangelog.xml Check Name: Changesets Must Have a Context Assigned (ChangesetContextCheck) Check Severity: INFO (Return code: 0) Message: Liquibase recommends that contexts be assigned to each changeset to provide better deployment control and to enhance traceability of efforts across changesets. Review the changeset indicated and consider adding a context to it. Changeset ID: 2 Changeset Filepath: dbchangelog.xml Check Name: Changesets Must Have a Comment Assigned (ChangesetCommentCheck) Check Severity: INFO (Return code: 0) Message: Liquibase recommends that authors include comments about the purpose and impact of a changeset in <comment< elements to prevent the development of undocumented or siloed knowledge and ensure that the purpose of a given changeset is easily understood by other people who use this changelog. Changesets Validated: ID: 1; Author: username; File path: dbchangelog.xml ID: 2; Author: username; File path: dbchangelog.xml run against each changeset: Warn on Detection of 'GRANT' Statements Warn on Detection of 'REVOKE' Statements Warn when 'DROP TABLE' detected Warn when 'DROP COLUMN' detected Warn when 'MODIFY <column<' detected Check Table Column Count Warn when 'TRUNCATE TABLE' detected Warn on Detection of grant that contains 'WITH GRANT OPTION' Warn on Detection of grant that contains 'WITH ADMIN OPTION' Rollback Required for Changeset Changesets Must Have a Label Assigned Changesets Must Have a Context Assigned Changesets Must Have a Comment Assigned [INFO] ------------------------------------------------------------------------ [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.110 s [INFO] Finished at: 2022-03-02T09:31:47-06:00 [INFO] ------------------------------------------------------------------------