Class AbstractLiquibaseMojo

    • Field Detail

      • preserveSchemaCase

        @PropertyElement
        protected Boolean preserveSchemaCase
        Specifies whether to preserve the case of schemas and catalogs
      • driver

        @PropertyElement
        protected String driver
        Specifies the driver class name to use for the database connection.
      • wagonManager

        protected org.apache.maven.artifact.manager.WagonManager wagonManager
        The Maven Wagon manager to use when obtaining server authentication details.
      • username

        @PropertyElement
        protected String username
        Specifies the database username for database connection.
      • password

        @PropertyElement
        protected String password
        Specifies the database password for database connection.
      • emptyPassword

        @PropertyElement
        protected boolean emptyPassword
        Deprecated.
        Use an empty or null value for the password instead.
        Use an empty string as the password for the database connection. This should not be used along side the password setting.
      • outputDefaultSchema

        @PropertyElement
        protected boolean outputDefaultSchema
        Specifies whether to ignore the schema name.
      • outputDefaultCatalog

        @PropertyElement
        protected boolean outputDefaultCatalog
        Specifies whether to ignore the catalog/database name.
      • defaultCatalogName

        @PropertyElement
        protected String defaultCatalogName
        Specifies the default catalog name to use for the database connection.
      • defaultSchemaName

        @PropertyElement
        protected String defaultSchemaName
        Specifies the default schema name to use for the database connection.
      • propertyProviderClass

        @PropertyElement
        protected String propertyProviderClass
        Specifies the property provider which must be a java.util.Properties implementation.
      • promptOnNonLocalDatabase

        @PropertyElement
        protected boolean promptOnNonLocalDatabase
        Deprecated.
        No longer prompts
        (DEPRECATED) Controls whether users are prompted before executing changeSet to a non-local database.
      • includeArtifact

        @PropertyElement
        protected boolean includeArtifact
        Includes a Maven project artifact in the class loader which obtains the liquibase.properties and changelog files.
      • includeTestOutputDirectory

        @PropertyElement
        protected boolean includeTestOutputDirectory
        Includes the Maven test output directory in the class loader which obtains the liquibase.properties and changelog files.
      • verbose

        @PropertyElement
        protected boolean verbose
        Controls the amount of output detail when you call the plugin.
      • logging

        @PropertyElement
        protected String logging
        Deprecated.
        Logging managed by maven
        Deprecated and ignored configuration property. Logging is managed via the standard maven logging system either using the -e, -X or -q flags or the ${maven.home}/conf/logging/simplelogger.properties file.
        See Also:
        maven-logging for more information.
      • logLevel

        @PropertyElement
        protected String logLevel
        Determines the minimum log level liquibase uses when logging.

        Supported values are:

        • DEBUG
        • INFO
        • WARNING
        • ERROR
        The primary use case for this option is to reduce the amount of logs from liquibase, while not changing the log level of maven itself, without changing ${maven.home}/conf/logging/simplelogger.properties.

        NOTE: The final log level is the maximum of this value and the maven log level. Thus, it is not possible to decrease the effective log level with this option.

      • propertyFile

        @PropertyElement
        protected String propertyFile
        Specifies the liquibase.properties you want to use to configure Liquibase.
      • propertyFileWillOverride

        @PropertyElement
        protected boolean propertyFileWillOverride
        A flag which indicates 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.
      • clearCheckSums

        @PropertyElement
        protected boolean clearCheckSums
        A flag that forces checksums to be cleared from the DATABASECHANGELOG table.
      • systemProperties

        @PropertyElement
        protected Properties systemProperties
        Specifies a list of system properties you want to pass to the database.
      • project

        protected org.apache.maven.project.MavenProject project
        The Maven project that plugin is running under.
      • session

        protected org.apache.maven.execution.MavenSession session
      • mojoExecution

        protected org.apache.maven.plugin.MojoExecution mojoExecution
      • skip

        @PropertyElement
        protected boolean skip
        Specifies whether to skip running Liquibase. The use of this parameter is NOT RECOMMENDED but can be used when needed.
      • skipOnFileExists

        @PropertyElement
        protected String skipOnFileExists
        Skip plugin execution if the specified file exists. The use of this parameter is NOT RECOMMENDED but can be used when needed.
      • outputFileEncoding

        @PropertyElement
        protected String outputFileEncoding
        A flag which indicates you want to set the character encoding of the output file during the updateSQL phase.
      • changelogCatalogName

        @PropertyElement
        protected String changelogCatalogName
        Specifies the schema Liquibase will use to create your changelog tables.
      • changelogSchemaName

        @PropertyElement
        protected String changelogSchemaName
        Specifies the schema Liquibase will use to create your changelog table.
      • databaseChangeLogTableName

        @PropertyElement
        protected String databaseChangeLogTableName
        Specifies the table name to use for the DATABASECHANGELOG table.
      • databaseChangeLogLockTableName

        @PropertyElement
        protected String databaseChangeLogLockTableName
        Specifies the table name to use for the DATABASECHANGELOGLOCK table.
      • showBanner

        @PropertyElement
        protected boolean showBanner
        Show the liquibase banner in output.
      • searchPath

        @PropertyElement
        protected String searchPath
        Specifies the locations where Liquibase can find your changelog files.
      • psqlKeepTempName

        @PropertyElement
        protected String psqlKeepTempName
        Specifies the name of generated psql files.
      • psqlKeepTempPath

        @PropertyElement
        protected String psqlKeepTempPath
        Specifies where to keep generated psql files.
      • sqlPlusKeepTemp

        @PropertyElement
        protected Boolean sqlPlusKeepTemp
        Specifies whether to keep generated sqlplus files.
      • sqlPlusKeepTempName

        @PropertyElement
        protected String sqlPlusKeepTempName
        Specifies the name of generated sqlplus files.
      • sqlPlusKeepTempPath

        @PropertyElement
        protected String sqlPlusKeepTempPath
        Specifies where to keep generated sqlplus files.
      • sqlPlusKeepTempOverwrite

        @PropertyElement
        protected Boolean sqlPlusKeepTempOverwrite
        Specifies whether to overwrite generated sqlplus files.
      • sqlcmdKeepTemp

        @PropertyElement
        protected Boolean sqlcmdKeepTemp
        Specifies whether to keep generated sqlcmd files.
      • sqlcmdKeepTempName

        @PropertyElement
        protected String sqlcmdKeepTempName
        Specifies the name of generated sqlcmd files.
      • sqlcmdKeepTempPath

        @PropertyElement
        protected String sqlcmdKeepTempPath
        Specifies where to keep generated sqlcmd files.
      • sqlcmdKeepTempOverwrite

        @PropertyElement
        protected Boolean sqlcmdKeepTempOverwrite
        Specifies whether to overwrite generated sqlcmd files.
      • changeExecListenerClass

        @PropertyElement
        protected String changeExecListenerClass
        Specifies the fully qualified class name of the custom ChangeExecListener
      • changeExecListenerPropertiesFile

        @PropertyElement
        protected String changeExecListenerPropertiesFile
        Specifies the property file for controlling the custom ChangeExecListener
      • logFormat

        @PropertyElement
        protected String logFormat
        Sets the format of log output to console or log files. Open Source users default to unstructured TXT logs to the console or output log files. Pro users have the option to set value as JSON or JSON_PRETTY to enable json-structured log files to the console or output log files.
      • dbclHistoryEnabled

        @PropertyElement(key="liquibase.dbclHistory.enabled")
        protected Boolean dbclHistoryEnabled
        This property enables Liquibase Pro users to store a record of all database changing liquibase operations in a new table DATABASECHANGELOGHISTORY. This table includes records of rollback, dropalls, and repeated runOnChange type activity, which is not available in the standard DATABASECHANGELOG table.
      • databaseChangelogHistoryEnabled

        @PropertyElement(key="liquibase.databaseChangelogHistory.enabled")
        protected Boolean databaseChangelogHistoryEnabled
        This property enables Liquibase Pro users to store a record of all database changing liquibase operations in a new table DATABASECHANGELOGHISTORY. This table includes records of rollback, dropalls, and repeated runOnChange type activity, which is not available in the standard DATABASECHANGELOG table.
      • dbclHistoryCaptureSql

        @PropertyElement(key="liquibase.dbclHistory.captureSql")
        protected Boolean dbclHistoryCaptureSql
        If true, executed SQL is captured in the history table
      • databaseChangelogHistoryCaptureSql

        @PropertyElement(key="liquibase.databaseChangelogHistory.captureSql")
        protected Boolean databaseChangelogHistoryCaptureSql
        If true, executed SQL is captured in the history table
      • dbclHistoryCaptureExtensions

        @PropertyElement(key="liquibase.dbclHistory.captureExtensions")
        protected Boolean dbclHistoryCaptureExtensions
        If true, extensions are captured in the history table
      • databaseChangelogHistoryCaptureExtensions

        @PropertyElement(key="liquibase.databaseChangelogHistory.captureExtensions")
        protected Boolean databaseChangelogHistoryCaptureExtensions
        If true, extensions are captured in the history table
      • commandName

        protected String commandName
    • Constructor Detail

      • AbstractLiquibaseMojo

        public AbstractLiquibaseMojo()
    • Method Detail

      • getLicenseKey

        protected String getLicenseKey()
        Get the specified license key. This first checks liquibaseLicenseKey and if no key is found, then returns liquibaseProLicenseKey.
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • getLiquibase

        protected Liquibase getLiquibase()
      • setupBindInfoPackage

        protected void setupBindInfoPackage()
      • isPromptOnNonLocalDatabase

        protected boolean isPromptOnNonLocalDatabase()
        Deprecated.
        no longer prompts
      • createLiquibase

        protected Liquibase createLiquibase​(Database db)
                                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • configureFieldsAndValues

        public void configureFieldsAndValues()
                                      throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • configureChangeLogProperties

        protected void configureChangeLogProperties()
                                             throws org.apache.maven.plugin.MojoFailureException,
                                                    org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoFailureException
        org.apache.maven.plugin.MojoExecutionException
      • getMavenArtifactClassLoader

        protected ClassLoader getMavenArtifactClassLoader()
                                                   throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getClassLoaderIncludingProjectClasspath

        protected ClassLoader getClassLoaderIncludingProjectClasspath()
                                                               throws org.apache.maven.plugin.MojoExecutionException
        Returns an isolated classloader.
        Returns:
        ClassLoader
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • checkRequiredParametersAreSpecified

        protected void checkRequiredParametersAreSpecified()
                                                    throws org.apache.maven.plugin.MojoFailureException
        Performs some validation after the properties file has been loaded checking that all properties required have been specified.
        Throws:
        org.apache.maven.plugin.MojoFailureException - If any property that is required has not been specified.
      • databaseConnectionRequired

        public boolean databaseConnectionRequired()
        Optionally, an implementation of this mojo can override this to indicate that a connection to the database is not required.
      • printSettings

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

        protected void cleanup​(Database db)
      • parsePropertiesFile

        protected void parsePropertiesFile​(InputStream propertiesInputStream)
                                    throws org.apache.maven.plugin.MojoExecutionException
        Parses a properties file and sets the associated fields in the plugin.
        Parameters:
        propertiesInputStream - The input stream which is the Liquibase properties that needs to be parsed.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If there is a problem parsing the file.
      • getLog

        public org.apache.maven.plugin.logging.Log getLog()
        Specified by:
        getLog in interface org.apache.maven.plugin.Mojo
        Overrides:
        getLog in class org.apache.maven.plugin.AbstractMojo
      • getOutputStream

        protected OutputStream getOutputStream​(String outputFile)
                                        throws LiquibaseException
        Returns the OutputStream based on whether there is an outputFile provided. If no outputFile parameter is provided, defaults to System.out.
        Parameters:
        outputFile - the string outputFile
        Returns:
        the OutputStream to use
        Throws:
        LiquibaseException - if we cannot create the provided outputFile