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
public class LiquibaseGenerateChangeLogMojo extends AbstractLiquibaseMojo
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
Fields Modifier and Type Field Description protected String
changeSetAuthor
The author to be specified for Changesets in the generated Change Log.protected String
changeSetContext
The execution context to be used for Changesets in the generated Change Log, which can be "," separated if multiple contexts.protected String
contexts
are required.protected String
dataDir
Directory where insert statement csv files will be kept.protected String
diffExcludeObjects
Objects to be excluded from the changelog.protected String
diffIncludeObjects
Objects to be included in the changelog.protected String
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.protected Boolean
includeSchema
Flag to Indicate liquibase whether or not to include schema name on changelogprotected String
outputChangeLogFile
The target change log file to output to.protected boolean
overwriteOutputFile
Flag to allow overwriting of output changelog fileprotected String
replaceIfExistsTypes
Sets replaceIfExists="true" for changes of the supported types, at the moment they are createView and createProcedure.protected String
runOnChangeTypes
Sets runOnChange="true" for changesets containing solely changes of these types (e.g.protected String
schemas
Specifies the a list of schemas to indicate liquibase where to apply change objects or where to read current state fromprotected boolean
useOrReplaceOption
Flag to allow adding 'OR REPLACE' option to the create view change object when generating changelog in SQL format-
Fields 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, systemProperties, url, username, verbose, wagonManager
-
-
Constructor Summary
Constructors Constructor Description LiquibaseGenerateChangeLogMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkRequiredParametersAreSpecified()
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
-
-
-
-
Field Detail
-
diffTypes
@PropertyElement protected String 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
@PropertyElement protected String dataDir
Directory where insert statement csv files will be kept.
-
changeSetAuthor
@PropertyElement protected String changeSetAuthor
The author to be specified for Changesets in the generated Change Log.
-
contexts
@PropertyElement protected String contexts
are required. If no context is specified then ALL contexts will be executed.
-
changeSetContext
@PropertyElement protected String changeSetContext
The execution context to be used for Changesets in the generated Change Log, which can be "," separated if multiple contexts.
-
outputChangeLogFile
@PropertyElement protected String outputChangeLogFile
The target change log file to output to. If this is null then the output will be to the screen.
-
diffExcludeObjects
@PropertyElement protected String diffExcludeObjects
Objects to be excluded from the changelog. Example filters: "table_name", "table:main_.*", "column:*._lock, table:primary.*".
-
diffIncludeObjects
@PropertyElement protected String diffIncludeObjects
Objects to be included in the changelog. Example filters: "table_name", "table:main_.*", "column:*._lock, table:primary.*".
-
schemas
@PropertyElement protected String schemas
Specifies the a list of schemas to indicate liquibase where to apply change objects or where to read current state from
-
includeSchema
@PropertyElement protected Boolean includeSchema
Flag to Indicate liquibase whether or not to include schema name on changelog
-
overwriteOutputFile
@PropertyElement protected boolean overwriteOutputFile
Flag to allow overwriting of output changelog file
-
runOnChangeTypes
@PropertyElement protected String runOnChangeTypes
Sets runOnChange="true" for changesets containing solely changes of these types (e.g. createView, createProcedure, ...).
-
replaceIfExistsTypes
@PropertyElement protected String replaceIfExistsTypes
Sets replaceIfExists="true" for changes of the supported types, at the moment they are createView and createProcedure.
-
useOrReplaceOption
@PropertyElement protected boolean useOrReplaceOption
Flag to allow adding 'OR REPLACE' option to the create view change object when generating changelog in SQL format
-
-
Method Detail
-
performLiquibaseTask
protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException
- Specified by:
performLiquibaseTask
in classAbstractLiquibaseMojo
- Throws:
LiquibaseException
-
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.- Overrides:
checkRequiredParametersAreSpecified
in classAbstractLiquibaseMojo
- Throws:
org.apache.maven.plugin.MojoFailureException
- If any property that is required has not been specified.
-
printSettings
protected void printSettings(String indent)
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.
-
-