Class LiquibaseDatabaseDiff

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    public class LiquibaseDatabaseDiff
    extends AbstractLiquibaseChangeLogMojo

    Generates a diff between the specified database and the reference database. The output is either a report or a changelog depending on the value of the diffChangeLogFile parameter.

    • Field Detail

      • referenceUrl

        protected String referenceUrl
        The reference database URL to connect to for executing Liquibase.
      • referenceUsername

        protected String referenceUsername
        The reference database username to use to connect to the specified database.
      • referencePassword

        protected String referencePassword
        The reference database password to use to connect to the specified database. If this is null then an empty password will be used.
      • referenceDefaultCatalogName

        protected String referenceDefaultCatalogName
        The reference database catalog.
      • referenceDefaultSchemaName

        protected String referenceDefaultSchemaName
        The reference database schema.
      • diffChangeLogFile

        protected String diffChangeLogFile
        If this parameter is set, the changelog needed to "fix" differences between the two databases is output. If the file exists, it is appended to. If this is null, a comparison report is output to stdout.
      • diffIncludeCatalog

        protected boolean diffIncludeCatalog
        Include the catalog in the diff output? If this is null then the catalog will not be included
      • diffIncludeSchema

        protected boolean diffIncludeSchema
        Include the schema in the diff output? If this is null then the schema will not be included
      • diffIncludeTablespace

        protected boolean diffIncludeTablespace
        Include the tablespace in the diff output? If this is null then the tablespace will not be included
      • diffTypes

        protected String diffTypes
        List of diff types to include in Change Log expressed as a comma separated list from: tables, views, columns, indexes, foreignkeys, primarykeys, uniqueconstraints, data. If this is null then the default types will be: tables, views, columns, indexes, foreignkeys, primarykeys, uniqueconstraints
      • changeSetAuthor

        protected String changeSetAuthor
        The author to be specified for Changesets in the generated Change Log.
      • diffExcludeObjects

        protected String diffExcludeObjects
        Objects to be excluded from the changelog. Example filters: "table_name", "table:main_.*", "column:*._lock, table:primary.*".
      • diffIncludeObjects

        protected String diffIncludeObjects
        Objects to be included in the changelog. Example filters: "table_name", "table:main_.*", "column:*._lock, table:primary.*".
      • referenceServer

        protected String referenceServer
        The server id in settings.xml to use when authenticating with.
      • schemas

        protected String schemas
        Schemas on target database to use in diff. This is a CSV list.
      • referenceSchemas

        protected String referenceSchemas
        Schemas names on reference database to use in diff. This is a CSV list.
      • runOnChangeTypes

        protected String runOnChangeTypes
        Sets runOnChange="true" for changesets containing solely changes of these types (e.g. createView, createProcedure, ...).
      • replaceIfExistsTypes

        protected String replaceIfExistsTypes
        Sets replaceIfExists="true" for changes of the supported types, at the moment they are createView and createProcedure.
      • useOrReplaceOption

        protected boolean useOrReplaceOption
        Flag to allow adding 'OR REPLACE' option to the create view change object when generating changelog in SQL format
    • Constructor Detail

      • LiquibaseDatabaseDiff

        public LiquibaseDatabaseDiff()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
        Specified by:
        execute in interface org.apache.maven.plugin.Mojo
        execute in class AbstractLiquibaseMojo
      • printSettings

        protected void printSettings​(String indent)
        Description copied from class: AbstractLiquibaseMojo
        Prints the settings that have been set of defaulted for the plugin. These will only be shown in verbose mode.
        printSettings in class AbstractLiquibaseChangeLogMojo
        indent - The indent string to use when printing the settings.
      • checkRequiredParametersAreSpecified

        protected void checkRequiredParametersAreSpecified()
                                                    throws org.apache.maven.plugin.MojoFailureException
        Description copied from class: AbstractLiquibaseMojo
        Performs some validation after the properties file has been loaded checking that all properties required have been specified.
        checkRequiredParametersAreSpecified in class AbstractLiquibaseChangeLogMojo
        org.apache.maven.plugin.MojoFailureException - If any property that is required has not been specified.