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 StringThe author to be specified for Changesets in the generated Change Log.protected StringThe execution context to be used for Changesets in the generated Change Log, which can be "," separated if multiple contexts.protected Stringare required.protected StringDirectory where insert statement csv files will be kept.protected StringObjects to be excluded from the changelog.protected StringObjects to be included in the changelog.protected StringList of diff types to include in Change Log expressed as a comma separated list from: tables, views, columns, indexes, foreignkeys, primarykeys, uniqueconstraints, data.protected BooleanFlag to Indicate liquibase whether or not to include schema name on changelogprotected StringThe target change log file to output to.protected booleanFlag to allow overwriting of output changelog fileprotected StringSets replaceIfExists="true" for changes of the supported types, at the moment they are createView and createProcedure.protected StringSets runOnChange="true" for changesets containing solely changes of these types (e.g. createView, createProcedure, ...).protected StringSpecifies the a list of schemas to indicate liquibase where to apply change objects or where to read current state fromprotected booleanFlag 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
analyticsEnabled, changeExecListenerClass, changeExecListenerPropertiesFile, changelogCatalogName, changelogSchemaName, clearCheckSums, commandName, databaseChangeLogLockTableName, databaseChangeLogTableName, databaseClass, defaultCatalogName, defaultChangeExecListener, defaultSchemaName, driver, emptyPassword, includeArtifact, includeTestOutputDirectory, logging, logLevel, mojoExecution, outputDefaultCatalog, outputDefaultSchema, outputFileEncoding, password, preserveSchemaCase, project, promptOnNonLocalDatabase, propertyFile, propertyFileWillOverride, propertyProviderClass, searchPath, session, showBanner, skip, skipOnFileExists, suppressLiquibaseSql, systemProperties, url, username, verbose, wagonManagerFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPerforms some validation after the properties file has been loaded checking that all properties required have been specified.protected voidperformLiquibaseTask(Liquibase liquibase) protected voidprintSettings(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, getLiquibase, getLog, getMavenArtifactClassLoader, getOutputStream, getOutputWriter, getResourceAccessor, isPromptOnNonLocalDatabase, parsePropertiesFile, setupBindInfoPackageMethods 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:
performLiquibaseTaskin 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:
checkRequiredParametersAreSpecifiedin classAbstractLiquibaseMojo- Throws:
org.apache.maven.plugin.MojoFailureException- If any property that is required has not been specified.
-
printSettings
Description copied from class:AbstractLiquibaseMojoPrints the settings that have been set of defaulted for the plugin. These will only be shown in verbose mode.- Overrides:
printSettingsin classAbstractLiquibaseMojo- Parameters:
indent- The indent string to use when printing the settings.
-