Package org.liquibase.maven.plugins
Class LiquibaseGenerateChangeLogMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.liquibase.maven.plugins.AbstractLiquibaseMojo
org.liquibase.maven.plugins.LiquibaseGenerateChangeLogMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
Generates a changelog based on the current database schema. Typically used when beginning to use Liquibase on an existing project and database schema.
- Since:
- 2.0.6
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
The author to be specified for Changesets in the generated Change Log.protected String
The execution context to be used for Changesets in the generated Change Log, which can be "," separated if multiple contexts.protected String
are required.protected String
Directory where insert statement csv files will be kept.protected String
Objects to be excluded from the changelog.protected String
Objects to be included in the changelog.protected String
List of diff types to include in Change Log expressed as a comma separated list from: tables, views, columns, indexes, foreignkeys, primarykeys, uniqueconstraints, data.protected Boolean
Flag to Indicate liquibase whether or not to include schema name on changelogprotected String
The target change log file to output to.protected boolean
Flag to allow overwriting of output changelog fileprotected String
Sets replaceIfExists="true" for changes of the supported types, at the moment they are createView and createProcedure.protected String
Sets runOnChange="true" for changesets containing solely changes of these types (e.g. createView, createProcedure, ...).protected String
Specifies the a list of schemas to indicate liquibase where to apply change objects or where to read current state fromprotected boolean
Flag to allow adding 'OR REPLACE' option to the create view change object when generating changelog in SQL formatFields inherited from class org.liquibase.maven.plugins.AbstractLiquibaseMojo
changeExecListenerClass, changeExecListenerPropertiesFile, changelogCatalogName, changelogSchemaName, clearCheckSums, commandName, databaseChangelogHistoryCaptureExtensions, databaseChangelogHistoryCaptureSql, databaseChangelogHistoryEnabled, databaseChangeLogLockTableName, databaseChangeLogTableName, databaseClass, dbclHistoryCaptureExtensions, dbclHistoryCaptureSql, dbclHistoryEnabled, defaultCatalogName, defaultChangeExecListener, defaultSchemaName, driver, emptyPassword, includeArtifact, includeTestOutputDirectory, logFormat, logging, logLevel, mojoExecution, outputDefaultCatalog, outputDefaultSchema, outputFileEncoding, password, preserveSchemaCase, project, promptOnNonLocalDatabase, propertyFile, propertyFileWillOverride, propertyProviderClass, psqlArgs, psqlKeepTemp, psqlKeepTempName, psqlKeepTempPath, psqlLogFile, psqlPath, psqlTimeout, searchPath, session, showBanner, skip, skipOnFileExists, sqlcmdArgs, sqlcmdCatalogName, sqlcmdKeepTemp, sqlcmdKeepTempName, sqlcmdKeepTempOverwrite, sqlcmdKeepTempPath, sqlcmdLogFile, sqlcmdPath, sqlcmdTimeout, sqlPlusArgs, sqlPlusKeepTemp, sqlPlusKeepTempName, sqlPlusKeepTempOverwrite, sqlPlusKeepTempPath, sqlPlusLogFile, sqlPlusPath, sqlPlusTimeout, suppressLiquibaseSql, systemProperties, url, username, verbose, wagonManager
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Performs some validation after the properties file has been loaded checking that all properties required have been specified.protected void
performLiquibaseTask
(Liquibase liquibase) protected void
printSettings
(String indent) Prints the settings that have been set of defaulted for the plugin.Methods inherited from class org.liquibase.maven.plugins.AbstractLiquibaseMojo
cleanup, configureChangeLogProperties, configureFieldsAndValues, createLiquibase, databaseConnectionRequired, execute, getClassLoaderIncludingProjectClasspath, getField, getLicenseKey, getLiquibase, getLog, getMavenArtifactClassLoader, getOutputStream, getOutputWriter, getResourceAccessor, isPromptOnNonLocalDatabase, parsePropertiesFile, setPassword, setupBindInfoPackage, setUrl, setUsername
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getPluginContext, setLog, setPluginContext
-
Field Details
-
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 -
dataDir
Directory where insert statement csv files will be kept. -
changeSetAuthor
The author to be specified for Changesets in the generated Change Log. -
contexts
are required. If no context is specified then ALL contexts will be executed. -
changeSetContext
The execution context to be used for Changesets in the generated Change Log, which can be "," separated if multiple contexts. -
outputChangeLogFile
The target change log file to output to. If this is null then the output will be to the screen. -
diffExcludeObjects
Objects to be excluded from the changelog. Example filters: "table_name", "table:main_.*", "column:*._lock, table:primary.*". -
diffIncludeObjects
Objects to be included in the changelog. Example filters: "table_name", "table:main_.*", "column:*._lock, table:primary.*". -
schemas
Specifies the a list of schemas to indicate liquibase where to apply change objects or where to read current state from -
includeSchema
Flag to Indicate liquibase whether or not to include schema name on changelog -
overwriteOutputFile
Flag to allow overwriting of output changelog file -
runOnChangeTypes
Sets runOnChange="true" for changesets containing solely changes of these types (e.g. createView, createProcedure, ...). -
replaceIfExistsTypes
Sets replaceIfExists="true" for changes of the supported types, at the moment they are createView and createProcedure. -
useOrReplaceOption
Flag to allow adding 'OR REPLACE' option to the create view change object when generating changelog in SQL format
-
-
Constructor Details
-
LiquibaseGenerateChangeLogMojo
public LiquibaseGenerateChangeLogMojo()
-
-
Method Details
-
performLiquibaseTask
- Specified by:
performLiquibaseTask
in classAbstractLiquibaseMojo
- Throws:
LiquibaseException
-
checkRequiredParametersAreSpecified
protected void checkRequiredParametersAreSpecified() throws org.apache.maven.plugin.MojoFailureExceptionPerforms some validation after the properties file has been loaded checking that all properties required have been specified.- Overrides:
checkRequiredParametersAreSpecified
in classAbstractLiquibaseMojo
- Throws:
org.apache.maven.plugin.MojoFailureException
- If any property that is required has not been specified.
-
printSettings
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.- Overrides:
printSettings
in classAbstractLiquibaseMojo
- Parameters:
indent
- The indent string to use when printing the settings.
-