Package org.liquibase.maven.plugins
Class AbstractLiquibaseChangeLogMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.liquibase.maven.plugins.AbstractLiquibaseMojo
-
- org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractLiquibaseUpdateMojo
,LiquibaseChangeLogSyncMojo
,LiquibaseChangeLogSyncSQLMojo
,LiquibaseChangeLogSyncToTagMojo
,LiquibaseChangeLogSyncToTagSQLMojo
,LiquibaseDatabaseDiff
,LiquibaseDBDocMojo
,LiquibaseReportStatusMojo
,LiquibaseRollback
,LiquibaseRollbackOneChangeSetMojo
,LiquibaseRollbackOneChangeSetSQL
,LiquibaseRollbackOneUpdateMojo
,LiquibaseRollbackOneUpdateSQL
,LiquibaseUnexpectedChangeSetsMojo
,LiquibaseValidate
public abstract class AbstractLiquibaseChangeLogMojo extends AbstractLiquibaseMojo
A Liquibase MOJO that requires the user to provide a DatabaseChangeLogFile to be able to perform any actions on the database.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
changeLogDirectory
Specifies the directory where Liquibase can find your changelog file.protected String
changeLogFile
Specifies the changelog file for Liquibase to use.protected String
contexts
Specifies which contexts Liquibase will execute, which can be separated by a comma if multiple contexts are required.protected String
duplicateFileMode
How to handle multiple files being found in the search path that have duplicate paths.protected String
labelFilter
Specifies which Liquibase labels Liquibase will execute, which can be separated by a comma if multiple labels are required or you need to designate a more complex expression.protected String
labels
Deprecated.-
Fields inherited from class org.liquibase.maven.plugins.AbstractLiquibaseMojo
changeExecListenerClass, changeExecListenerPropertiesFile, changelogCatalogName, changelogSchemaName, clearCheckSums, commandName, databaseChangeLogLockTableName, databaseChangeLogTableName, databaseClass, defaultCatalogName, defaultChangeExecListener, defaultSchemaName, driver, emptyPassword, includeArtifact, includeTestOutputDirectory, logFormat, logging, logLevel, outputDefaultCatalog, outputDefaultSchema, outputFileEncoding, password, preserveSchemaCase, project, promptOnNonLocalDatabase, propertyFile, propertyFileWillOverride, propertyProviderClass, psqlArgs, psqlKeepTemp, psqlKeepTempName, psqlKeepTempPath, psqlLogFile, psqlPath, psqlTimeout, searchPath, 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 AbstractLiquibaseChangeLogMojo()
-
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 Liquibase
createLiquibase(Database db)
String
getLabelFilter()
protected ResourceAccessor
getResourceAccessor(ClassLoader cl)
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.AbstractLiquibaseMojo
cleanup, configureChangeLogProperties, configureFieldsAndValues, databaseConnectionRequired, execute, getClassLoaderIncludingProjectClasspath, getField, getLicenseKey, getLiquibase, getLog, getMavenArtifactClassLoader, getOutputStream, getOutputWriter, isPromptOnNonLocalDatabase, parsePropertiesFile, setupBindInfoPackage
-
-
-
-
Field Detail
-
changeLogDirectory
@PropertyElement protected String changeLogDirectory
Specifies the directory where Liquibase can find your changelog file. This is an aliases for searchPath
-
changeLogFile
@PropertyElement protected String changeLogFile
Specifies the changelog file for Liquibase to use.
-
contexts
@PropertyElement protected String contexts
Specifies which contexts Liquibase will execute, which can be separated by a comma if multiple contexts are required. If a context is not specified, then ALL contexts will be executed.
-
labels
@PropertyElement protected String labels
Deprecated.Deprecated version of labelFilter
-
labelFilter
@PropertyElement protected String labelFilter
Specifies which Liquibase labels Liquibase will execute, which can be separated by a comma if multiple labels are required or you need to designate a more complex expression. If a label is not specified, then ALL labels will be executed.
-
duplicateFileMode
@PropertyElement protected String duplicateFileMode
How to handle multiple files being found in the search path that have duplicate paths. Options are WARN (log warning and choose one at random) or ERROR (fail current operation)
-
-
Method Detail
-
checkRequiredParametersAreSpecified
protected void checkRequiredParametersAreSpecified() throws org.apache.maven.plugin.MojoFailureException
Description copied from class:AbstractLiquibaseMojo
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.
-
performLiquibaseTask
protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException
Performs the actual Liquibase task on the database using the fully configuredLiquibase
.- Specified by:
performLiquibaseTask
in classAbstractLiquibaseMojo
- Parameters:
liquibase
- TheLiquibase
that has been fully configured to run the desired database task.- Throws:
LiquibaseException
-
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.
-
getResourceAccessor
protected ResourceAccessor getResourceAccessor(ClassLoader cl) throws IOException, org.apache.maven.plugin.MojoFailureException
- Overrides:
getResourceAccessor
in classAbstractLiquibaseMojo
- Throws:
IOException
org.apache.maven.plugin.MojoFailureException
-
createLiquibase
protected Liquibase createLiquibase(Database db) throws org.apache.maven.plugin.MojoExecutionException
- Overrides:
createLiquibase
in classAbstractLiquibaseMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getLabelFilter
public String getLabelFilter()
-
-