Maven changelogSyncToTagSQL
Last updated: July 14, 2025
The changelogSyncToTagSQL goal is a helper goal that produces the raw SQL that Liquibase would run when using the changelogSyncToTag goal to mark all undeployed changesets associated with the specified tag as executed in your database.
Uses
The changelogSyncSQL
goal is typically used when you want to inspect the SQL Liquibase will use to baseline a new database environment and update the DATABASECHANGELOG table to mark all changes that are not applied to the database as executed.
It is best practice to inspect any SQL that Liquibase would run when using the changelogSync
goal, so you can review any changes the goal would make to your database before running the goal.
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 changelogSyncSQL Maven goal
Running the changelogSyncSQL
goal requires a Maven project to be implemented. To run the goal, type the following in your command prompt:
mvn liquibase:changelogSyncSQL
Note: You can also add the liquibase.migrationSqlOutputFile
attribute and specify the file to output the migration SQL script. The default file is migrate.sql
. If it exists, it will be overwritten.
Maven changelogSyncToTagSQL configuration attributes
Required Maven changelogSyncToTagSQL configuration attributes
Attribute | Definition |
---|---|
| Syncs the changesets up to and including the tag. |
Maven changelogSyncToTagSQL output
Starting Liquibase at 03:55:32 (version 4.3.2 #44 built at 2021-03-23 14:01+0000)
[INFO] Char encoding not set! The created file will be system dependent!
[INFO] Output SQL Migration File: C:\Users\Nataliya.WIN-20E107KB4TN\Desktop\Liquibase Projects\Maven Projects\my-liquibase-app\target\liquibase\migrate.sql
[INFO] Parsing Liquibase Properties File local.liquibase.properties for changeLog parameters
[INFO] Executing on Database: jdbc:oracle:thin:@localhost:1521/ORCL
[INFO] Successfully acquired change log lock
[INFO] Reading from DATABASECHANGELOG
[INFO] Successfully released change log lock
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.202 s
[INFO] Finished at: 2021-03-31T03:55:40-05:00
[INFO] ------------------------------------------------------------------------