global-strip-comments
Last updated: September 2, 2025
--global-strip-comments is a global Boolean parameter that specifies whether to remove any comments in a SQL statement before executing. The default value is true.
The--global-strip-comments is similar to the stripComments attribute for the sql, sqlFile, partiql, and partiqlFile Change Types, but has a global scope.
It is available in Liquibase Secure 5.0 and later and requires a valid Liquibase Secure license key to use.
From Liquibase Pro version 4.29.2 through 4.33, this parameter was called --pro-global-strip-comments. See the change history table at the end of this article for pre-5.0 version syntax.
If you set --global-strip-comments and do not set stripComments
, then Liquibase applies the value of --global-strip-comments to all changesets. If you set both, Liquibase determines which value to use for a changeset in the following order:
stripComments
set on a specific changeset, including inrollbackSqlFile
(highest precedence)stripComments
set in a changelog called byinclude
orincludeAll
inmodifyChangeSets
--global-strip-comments
You can give --global-strip-comments the highest precedence of all settings by also using the --global-strip-comments
parameter.
Uses
By default, Liquibase strips SQL comments from any SQL changesets you deploy. However, you may want to keep the comments because they serve as documentation or version control.
You can use --global-strip-comments to set comment stripping behavior across all your changesets. This is easier than manually specifying stripComments
on every individual changeset. Also, having one central parameter for comment stripping behavior reduces inconsistencies resulting from manual updates to changesets.
Note: This parameter does not override the strip_comments(SQL_string)
helper function in Liquibase Python Modules. The custom policy check uses the original SQL from the Change
object.
Syntax
You can set this parameter in the following ways:
Option | Syntax |
Liquibase properties file (defaults file) | liquibase.globalStripComments: <true|false> |
Global flow file argument | globalArgs: { global-strip-comments: "<true|false>" } |
Global CLI parameter | liquibase --global-strip-comments=<true|false> update --changelog-file=example-changelog.xml |
JVM system property (JAVA_OPTS environment variable) | Unix: JAVA_OPTS=-Dliquibase.globalStripComments=<true|false> Windows: JAVA_OPTS=-D"liquibase.globalStripComments"=<true|false> |
Liquibase environment variable |
|
For more information, see Working with command parameters.
Change history
Version | Changes |
---|---|
Liquibase Secure, version 5.0 | Parameter changed from --pro-global-strip-comments to ----global-strip-comments. Here are the previous values from when it was --pro-global-strip-comments. Liquibase properties file(defaults file) liquibase.pro.globalEndDelimiter: <string> Global flow file argument globalArgs: { pro-global-end-delimiter: "<string>" } Global CLI parameter liquibase --pro-global-end-delimiter=<string> update --changelog-file=example-changelog.xml JVM system property(JAVA_OPTS environment variable) Unix: JAVA_OPTS=-Dliquibase.pro.globalEndDelimiter=<string> Windows: JAVA_OPTS=-D"liquibase.pro.globalEndDelimiter"=<string> |