Maven listLocks

Last updated: July 14, 2025

The Maven listLocks goal returns the hostname, IP address, and the timestamp the Liquibase lock record was added to the DATABASECHANGELOGLOCK table.

Uses

The Maven listLocks goal is typically used when an error occurs during a database deployment. The error might indicate that another user locked a record in the DATABASECHANGELOGLOCK table, preventing Liquibase from applying changes to the specified database.

The listLocks goal will read the DATABASECHANGELOGLOCK table and return a list that includes the hostname, IP address, and the timestamp the lock record was granted to the DATABASECHANGELOGLOCK table and determines the connections to the DATABASECHANGELOGLOCK table based on the database URL.

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.

Running the listLocks Maven goal

Running the listLocks goal requires a Maven project to be implemented. To run the goal, type the following in your command prompt:

mvn liquibase:listLocks

Maven listLocks

Optional Maven listLocks configuration attributes

Attribute

Definition

liquibase.changelogCatalogName

Specifies the catalog Liquibase will use to create your changelog tables.

liquibase.changelogSchemaName

Specifies the schema Liquibase will use to create your changelog tables.

liquibase.clearCheckSums

Boolean. Forces checksums to be cleared from the DATABASECHANGELOG table. Default value is: false.

liquibase.databaseChangeLogLockTableName

Specifies the table name to use for the DATABASECHANGELOG table.

liquibase.databaseChangeLogTableName

Specifies the table name to use for the DATABASECHANGELOG table.

liquibase.databaseClass

Specifies the database object class.

liquibase.defaultCatalogName

Specifies the default catalog name to use for the database connection.

liquibase.defaultSchemaName

Specifies the default schema name to use for the database connection.

liquibase.driver

Specifies the driver class name to use for the database connection.

driverPropertiesFile

Specifies the location of a JDBC connection properties file which contains properties the driver will use.

liquibase.emptyPassword

Deprecated. Boolean. Use an empty or null value for the password instead. Default value is: false.

expressionVariables

Specifies a map-based collection of changelog properties to apply.

expressionVars

Specifies a property-based collection of changelog properties to apply.

liquibase.includeArtifact

Boolean. Includes a Maven project artifact in the class loader, which obtains the Liquibase properties file and changelog files. Default value is true.

liquibase.includeTestOutputDirectory

Boolean. Includes the Maven test output directory in the class loader which obtains the Liquibase properties file and changelog files. Default value is true.

liquibase.licenseKey

Specifies your Liquibase Pro license key.

liquibase.outputDefaultCatalog

Boolean. Specifies whether to ignore the catalog or database name. Default value is: false.

liquibase.outputDefaultSchema

Boolean. Specifies whether to ignore the schema name. Default value is: false.

liquibase.outputFileEncoding

Indicates that you want to set the character encoding of the output file during the updateSQL phase.

liquibase.password

Specifies the database password for the database connection.

liquibase.promptOnNonLocalDatabase

Deprecated. Boolean. Controls whether users are prompted before executing changesets to a non-local database. Default value is: true.

liquibase.propertyFile

Specifies the Liquibase properties file to use for configuration, like liquibase.properties.

liquibase.propertyFileWillOverride

Boolean. Indicates that you want the liquibase.properties file to override any settings provided in the Maven plugin configuration. By default, if a property is explicitly specified, it is not overridden if it also appears in the properties file. Default value is: false.

liquibase.propertyProviderClass

Specifies the property provider, which must be a java.util.Properties implementation.

liquibase.server

Specifies the server ID in the Maven settings.xml to use when authenticating.

liquibase.skip

Boolean. Specifies whether to skip running Liquibase. The use of this attribute is not recommended but can be used when needed. Default value is: false.

systemProperties

Specifies a list of system properties you want to pass to the database.

liquibase.url

Specifies the database URL you want to use to execute Liquibase.

liquibase.username

Specifies the database username for the database connection.

liquibase.verbose

Boolean. Controls the amount of output detail when you call the plugin. Default value is: false.

Maven listLocks output

When successful, the listLocks Maven goal produces the following output when there is no lock on the table:

[INFO] Executing on Database: jdbc:oracle:thin:@support.datical.net:1521:ORCL [INFO] SELECT MD5SUM FROM DATABASECHANGELOG WHERE MD5SUM IS NOT NULL AND ROWNUM=1 [INFO] SELECT COUNT(*) FROM DATABASECHANGELOGLOCK [INFO] SELECT COUNT(*) FROM DATABASECHANGELOGLOCK [INFO] SELECT ID,LOCKED,LOCKGRANTED,LOCKEDBY FROM DATABASECHANGELOGLOCK WHERE ID=1 FOR UPDATE Database change log locks for MVN_UAT@jdbc:oracle:thin:@support.datical.net:1521:ORCL - No locks

When there is a lock on the table, the listLocks Maven goal produces the following output:

[INFO] Executing on Database: jdbc:oracle:thin:@localhost:1521/ORCL Database change log locks for MVN@jdbc:oracle:thin:@localhost:1521/ORCL - 2605:6000:101c:686:486:f4ae:82fe:3c99%en0 (2605:6000:101c:686:486:f4ae:82fe:3c99%en0) at Dec 30, 2020 3:21:05 PM [INFO] ------------------------------------------------------------------------ [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.722 s [INFO] Finished at: 2020-12-30T09:22:04-06:00 [INFO] ------------------------------------------------------------------------

Maven listLocks - Liquibase