class LiquibaseGenerateChangeLogMojo extends
        AbstractLiquibaseMojo {

    /**
     * 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
     *
     * @parameter property="liquibase.diffTypes"
     */
    @PropertyElement
    protected String diffTypes;

    /**
     * Directory where insert statement csv files will be kept.
     *
     * @parameter property="liquibase.dataDir"
     */
    @PropertyElement
    protected String dataDir;

    /**
     * The author to be specified for Changesets in the generated Change Log.
     *
     * @parameter property="liquibase.changeSetAuthor"
     */
    @PropertyElement
    protected String changeSetAuthor;

    /**
     * are required. If no context is specified then ALL contexts will be executed.
     * @parameter property="liquibase.contexts" default-value=""
     */
    @PropertyElement
    protected String contexts;

    /**
     * The execution context to be used for Changesets in the generated Change Log, which can be "," separated if multiple contexts.
     *
     * @parameter property="liquibase.changeSetContext"
     */
    @PropertyElement
    protected String changeSetContext;

    /**
     * The target change log file to output to. If this is null then the output will be to the screen.
     *
     * @parameter property="liquibase.outputChangeLogFile"
     */
    @PropertyElement
    protected String outputChangeLogFile;


    /**
     * Objects to be excluded from the changelog. Example filters: "table_name", "table:main_.*", "column:*._lock, table:primary.*".
     *
     * @parameter property="liquibase.diffExcludeObjects"
     */
    @PropertyElement
    protected String diffExcludeObjects;

    /**
     * Objects to be included in the changelog. Example filters: "table_name", "table:main_.*", "column:*._lock, table:primary.*".
     *
     * @parameter property="liquibase.diffIncludeObjects"
     */
    @PropertyElement
    protected String diffIncludeObjects;

    /**
     * Specifies the a list of schemas to indicate liquibase where to apply change objects or where to read current state from
     * @parameter property="liquibase.schemas"
     */
    @PropertyElement
    protected String schemas;

    /**
     * Flag to Indicate liquibase whether or not to include schema name on changelog
     * @parameter property="liquibase.includeSchema"
     */
    @PropertyElement
    protected  Boolean includeSchema;

    /**
     * Flag to allow overwriting of output changelog file
     *
     * @parameter property="liquibase.overwriteOutputFile" default-value="false"
     */
    @PropertyElement
    protected boolean overwriteOutputFile;

    /**
     * Sets runOnChange="true" for changesets containing solely changes of these types (e.g. createView, createProcedure, ...).
     *
     * @parameter property="liquibase.runOnChangeTypes" default-value="none"
     */
    @PropertyElement
    protected String runOnChangeTypes;

    /**
     * Sets replaceIfExists="true" for changes of the supported types, at the moment they are createView and createProcedure.
     *
     * @parameter property="liquibase.replaceIfExistsTypes" default-value="none"
     */
    @PropertyElement
    protected String replaceIfExistsTypes;

    /**
     * Flag to allow adding 'OR REPLACE' option to the create view change object when generating changelog in SQL format
     *
     * @parameter property="liquibase.useOrReplaceOption" default-value="false"
     */
    @PropertyElement
    protected boolean useOrReplaceOption;

    @Override
	protected void performLiquibaseTask(Liquibase liquibase)
			throws LiquibaseException {<FILL_FUNCTION_BODY>}

    /**
     * Performs some validation after the properties file has been loaded checking that all
     * properties required have been specified.
     *
     * @throws MojoFailureException If any property that is required has not been
     *                              specified.
     */
    @Override
    protected void checkRequiredParametersAreSpecified() throws MojoFailureException {
        super.checkRequiredParametersAreSpecified();
        if (outputChangeLogFile == null) {
            throw new MojoFailureException("The outputChangeLogFile property must be specified.");
        }
    }

    @Override
	protected void printSettings(String indent) {
		super.printSettings(indent);
        getLog().info(indent + "defaultSchemaName: " + defaultSchemaName);
        getLog().info(indent + "diffTypes: " + diffTypes);
        getLog().info(indent + "dataDir: " + dataDir);
	}

}


        ClassLoader cl = null;
        try {
            cl = getClassLoaderIncludingProjectClasspath();
            Thread.currentThread().setContextClassLoader(cl);
        }
        catch (MojoExecutionException e) {
            throw new LiquibaseException("Could not create the class loader, " + e, e);
        }

        Database database = liquibase.getDatabase();

        getLog().info("Generating Change Log from database " + database.toString());
        try {
            DiffOutputControl diffOutputControl = new DiffOutputControl(outputDefaultCatalog, includeSchema == null ? Boolean.FALSE : includeSchema, true, null);
            if ((diffExcludeObjects != null) && (diffIncludeObjects != null)) {
                throw new UnexpectedLiquibaseException("Cannot specify both excludeObjects and includeObjects");
            }
            if (diffExcludeObjects != null) {
                diffOutputControl.setObjectChangeFilter(new StandardObjectChangeFilter(StandardObjectChangeFilter.FilterType.EXCLUDE, diffExcludeObjects));
            }
            if (diffIncludeObjects != null) {
                diffOutputControl.setObjectChangeFilter(new StandardObjectChangeFilter(StandardObjectChangeFilter.FilterType.INCLUDE, diffIncludeObjects));
            }
            if(useOrReplaceOption) {
                diffOutputControl.setReplaceIfExistsSet(true);
            }

            //
            // Set the global configuration option based on presence of the dataOutputDirectory
            //
            boolean b = dataDir != null;
            Scope.child(GlobalConfiguration.SHOULD_SNAPSHOT_DATA.getKey(), b, () -> {
            CompareControl.ComputedSchemas computedSchemas = CompareControl.computeSchemas(schemas, null, null,
                    defaultCatalogName, defaultSchemaName, null, null, database);
            CatalogAndSchema[] targetSchemas = computedSchemas.finalTargetSchemas;

                CommandLineUtils.doGenerateChangeLog(outputChangeLogFile, database, targetSchemas, StringUtil.trimToNull(diffTypes),
                        StringUtil.trimToNull(changeSetAuthor), StringUtil.trimToNull(changeSetContext), StringUtil.trimToNull(dataDir), diffOutputControl, overwriteOutputFile, runOnChangeTypes, replaceIfExistsTypes);
                getLog().info("Output written to Change Log file, " + outputChangeLogFile);
            });
        }  catch (Exception e) {
            throw new LiquibaseException(e);
        }
    
<methods>public non-sealed void <init>() ,public void configureFieldsAndValues() throws MojoExecutionException,public boolean databaseConnectionRequired() ,public void execute() throws MojoExecutionException, MojoFailureException,public synchronized Log getLog() ,public void setPassword(java.lang.String) throws java.lang.Exception,public void setUrl(java.lang.String) throws java.lang.Exception,public void setUsername(java.lang.String) throws java.lang.Exception<variables>private static final java.lang.String DEFAULT_FIELD_SUFFIX,private static final Set<java.lang.String> EXCLUDED_CONFIGURATION_PROPERTIES,protected java.lang.String changeExecListenerClass,protected java.lang.String changeExecListenerPropertiesFile,protected java.lang.String changelogCatalogName,protected java.lang.String changelogSchemaName,protected boolean clearCheckSums,protected java.lang.String commandName,private static final java.util.ResourceBundle coreBundle,protected java.lang.String databaseChangeLogLockTableName,protected java.lang.String databaseChangeLogTableName,protected java.lang.Boolean databaseChangelogHistoryCaptureExtensions,protected java.lang.Boolean databaseChangelogHistoryCaptureSql,protected java.lang.Boolean databaseChangelogHistoryEnabled,protected java.lang.String databaseClass,protected java.lang.Boolean dbclHistoryCaptureExtensions,protected java.lang.Boolean dbclHistoryCaptureSql,protected java.lang.Boolean dbclHistoryEnabled,protected java.lang.String defaultCatalogName,protected liquibase.changelog.visitor.DefaultChangeExecListener defaultChangeExecListener,protected java.lang.String defaultSchemaName,protected java.lang.String driver,private java.io.File driverPropertiesFile,protected boolean emptyPassword,private Map#RAW expressionVariables,private java.util.Properties expressionVars,protected boolean includeArtifact,protected boolean includeTestOutputDirectory,private liquibase.Liquibase liquibase,private java.lang.String liquibaseLicenseKey,private java.lang.String liquibaseProLicenseKey,private org.liquibase.maven.plugins.MavenLog logCache,protected java.lang.String logFormat,protected java.lang.String logLevel,protected java.lang.String logging,protected MojoExecution mojoExecution,protected boolean outputDefaultCatalog,protected boolean outputDefaultSchema,protected java.lang.String outputFileEncoding,protected java.lang.String password,protected java.lang.Boolean preserveSchemaCase,protected MavenProject project,protected boolean promptOnNonLocalDatabase,protected java.lang.String propertyFile,protected boolean propertyFileWillOverride,protected java.lang.String propertyProviderClass,protected java.lang.String psqlArgs,protected java.lang.Boolean psqlKeepTemp,protected java.lang.String psqlKeepTempName,protected java.lang.String psqlKeepTempPath,protected java.lang.String psqlLogFile,protected java.lang.String psqlPath,protected java.lang.Integer psqlTimeout,protected java.lang.String searchPath,private java.lang.String server,protected MavenSession session,protected boolean showBanner,protected boolean skip,protected java.lang.String skipOnFileExists,protected java.lang.String sqlPlusArgs,protected java.lang.Boolean sqlPlusKeepTemp,protected java.lang.String sqlPlusKeepTempName,protected java.lang.Boolean sqlPlusKeepTempOverwrite,protected java.lang.String sqlPlusKeepTempPath,protected java.lang.String sqlPlusLogFile,protected java.lang.String sqlPlusPath,protected java.lang.Integer sqlPlusTimeout,protected java.lang.String sqlcmdArgs,protected java.lang.String sqlcmdCatalogName,protected java.lang.Boolean sqlcmdKeepTemp,protected java.lang.String sqlcmdKeepTempName,protected java.lang.Boolean sqlcmdKeepTempOverwrite,protected java.lang.String sqlcmdKeepTempPath,protected java.lang.String sqlcmdLogFile,protected java.lang.String sqlcmdPath,protected java.lang.Integer sqlcmdTimeout,protected java.util.Properties systemProperties,protected java.lang.String url,protected java.lang.String username,protected boolean verbose,protected WagonManager wagonManager