Package org.liquibase.maven.plugins
Class AbstractLiquibaseUpdateMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.liquibase.maven.plugins.AbstractLiquibaseMojo
-
- org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
-
- org.liquibase.maven.plugins.AbstractLiquibaseUpdateMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
LiquibaseUpdate
,LiquibaseUpdateSQL
,LiquibaseUpdateTestingRollback
public abstract class AbstractLiquibaseUpdateMojo extends AbstractLiquibaseChangeLogMojo
Liquibase Update Maven plugin. This plugin allows for DatabaseChangeLogs to be applied to a database as part of a Maven build process.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
changesToApply
The number of changes to apply to the database.protected boolean
rollbackOnError
If set to true and any changeset in a deployment fails, then the update operation stops, and liquibase attempts to rollback all changesets just deployed.protected UpdateSummaryEnum
showSummary
Whether or not to print a summary of the update operation.protected UpdateSummaryOutputEnum
showSummaryOutput
Flag to control where we show the summary.protected String
toTag
Update to the changeSet with the given tag command.-
Fields inherited from class org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
changeLogDirectory, changeLogFile, contexts, duplicateFileMode, labelFilter, labels
-
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 AbstractLiquibaseUpdateMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Liquibase
createLiquibase(Database db)
protected abstract void
doUpdate(Liquibase liquibase)
Performs the actual "update" work on the database.protected void
handleUpdateException(LiquibaseException exception)
protected void
performLiquibaseTask(Liquibase liquibase)
Performs the actual Liquibase task on the database using the fully configuredLiquibase
.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.AbstractLiquibaseChangeLogMojo
checkRequiredParametersAreSpecified, getLabelFilter, getResourceAccessor
-
Methods inherited from class org.liquibase.maven.plugins.AbstractLiquibaseMojo
cleanup, configureChangeLogProperties, configureFieldsAndValues, databaseConnectionRequired, execute, getClassLoaderIncludingProjectClasspath, getField, getLicenseKey, getLiquibase, getLog, getMavenArtifactClassLoader, getOutputStream, getOutputWriter, isPromptOnNonLocalDatabase, parsePropertiesFile, setPassword, setupBindInfoPackage, setUrl, setUsername
-
-
-
-
Field Detail
-
changesToApply
@PropertyElement protected int changesToApply
The number of changes to apply to the database. By default this value is 0, which will result in all changes (not already applied to the database) being applied.
-
toTag
protected String toTag
Update to the changeSet with the given tag command.
-
rollbackOnError
@PropertyElement protected boolean rollbackOnError
If set to true and any changeset in a deployment fails, then the update operation stops, and liquibase attempts to rollback all changesets just deployed. A changeset marked "fail-on-error=false" does not trigger as an error, therefore rollback-on-error will not occur. Additionally, if a changeset is not auto-rollback compliant or does not have a rollback script, then no rollback-on-error will occur for any changeset.
-
showSummary
@PropertyElement protected UpdateSummaryEnum showSummary
Whether or not to print a summary of the update operation. Allowed values: 'OFF', 'SUMMARY' (default), 'VERBOSE'
-
showSummaryOutput
@PropertyElement protected UpdateSummaryOutputEnum showSummaryOutput
Flag to control where we show the summary. Allowed values: 'LOG', 'CONSOLE', OR 'ALL' (default)
-
-
Method Detail
-
performLiquibaseTask
protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException
Description copied from class:AbstractLiquibaseChangeLogMojo
Performs the actual Liquibase task on the database using the fully configuredLiquibase
.- Overrides:
performLiquibaseTask
in classAbstractLiquibaseChangeLogMojo
- Parameters:
liquibase
- TheLiquibase
that has been fully configured to run the desired database task.- Throws:
LiquibaseException
-
doUpdate
protected abstract void doUpdate(Liquibase liquibase) throws LiquibaseException
Performs the actual "update" work on the database.- Parameters:
liquibase
- The Liquibase object to use to perform the "update".- Throws:
LiquibaseException
-
createLiquibase
protected Liquibase createLiquibase(Database db) throws org.apache.maven.plugin.MojoExecutionException
- Overrides:
createLiquibase
in classAbstractLiquibaseChangeLogMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
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 classAbstractLiquibaseChangeLogMojo
- Parameters:
indent
- The indent string to use when printing the settings.
-
handleUpdateException
protected void handleUpdateException(LiquibaseException exception) throws LiquibaseException
- Throws:
LiquibaseException
-
-