Class AbstractLiquibaseMojo

    • Field Detail

      • preserveSchemaCase

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

        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

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

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

        protected boolean emptyPassword
        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

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

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

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

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

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

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

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

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

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

        protected String logging
        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/ file.
        See Also:
        maven-logging for more information.
      • logLevel

        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/

        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

        protected String propertyFile
        Specifies the you want to use to configure Liquibase.
      • propertyFileWillOverride

        protected boolean propertyFileWillOverride
        A flag which indicates you want the 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

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

        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.
      • skip

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

        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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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.
      • 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,
      • getLiquibase

        protected Liquibase getLiquibase()
      • setupBindInfoPackage

        protected void setupBindInfoPackage()
      • isPromptOnNonLocalDatabase

        protected boolean isPromptOnNonLocalDatabase()
        no longer prompts
      • createLiquibase

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

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

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

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

        protected ClassLoader getClassLoaderIncludingProjectClasspath()
                                                               throws org.apache.maven.plugin.MojoExecutionException
        Returns an isolated classloader.
      • 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.
        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.
        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.
        propertiesInputStream - The input stream which is the Liquibase properties that needs to be parsed.
        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
        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.
        outputFile - the string outputFile
        the OutputStream to use
        LiquibaseException - if we cannot create the provided outputFile