public abstract class AbstractLiquibaseMojo
extends org.apache.maven.plugin.AbstractMojo
Liquibase functionality.| Modifier and Type | Field and Description |
|---|---|
protected String |
changelogCatalogName
Specifies the schema Liquibase will use to create your changelog tables.
|
protected String |
changelogSchemaName
Specifies the schema Liquibase will use to create your changelog table.
|
protected boolean |
clearCheckSums
A flag that forces checksums to be cleared from the DATABASECHANGELOG table.
|
protected String |
commandName |
protected String |
databaseChangeLogLockTableName
Specifies the table name to use for the DATABASECHANGELOGLOCK table.
|
protected String |
databaseChangeLogTableName
Specifies the table name to use for the DATABASECHANGELOG table.
|
protected String |
databaseClass
Specifies the database object class.
|
protected String |
defaultCatalogName
Specifies the default catalog name to use for the database connection.
|
protected String |
defaultSchemaName
Specifies the default schema name to use for the database connection.
|
protected String |
driver
Specifies the driver class name to use for the database connection.
|
protected boolean |
emptyPassword
Deprecated.
Use an empty or null value for the password instead.
|
protected boolean |
includeArtifact
Includes a Maven project artifact in the class loader which obtains the liquibase.properties and changelog files.
|
protected boolean |
includeTestOutputDirectory
Includes the Maven test output directory in the class loader which obtains the liquibase.properties and changelog files.
|
protected String |
logging
Deprecated.
Logging managed by maven
|
protected boolean |
outputDefaultCatalog
Specifies whether to ignore the catalog/database name.
|
protected boolean |
outputDefaultSchema
Specifies whether to ignore the schema name.
|
protected String |
outputFileEncoding
A flag which indicates you want to set the character encoding of the output file during the updateSQL phase.
|
protected String |
password
Specifies the database password for database connection.
|
protected Boolean |
preserveSchemaCase
Specifies whether to preserve the case of schemas and catalogs
|
protected org.apache.maven.project.MavenProject |
project
The Maven project that plugin is running under.
|
protected boolean |
promptOnNonLocalDatabase
Deprecated.
No longer prompts
|
protected String |
propertyFile
Specifies the liquibase.properties you want to use to configure Liquibase.
|
protected boolean |
propertyFileWillOverride
A flag which indicates you want the liquibase.properties file to override any settings provided in the Maven plugin configuration.
|
protected String |
propertyProviderClass
Specifies the property provider which must be a java.util.Properties implementation.
|
protected boolean |
showBanner
Show the liquibase banner in output.
|
protected boolean |
skip
Specifies whether to skip running Liquibase.
|
protected Properties |
systemProperties
Specifies a list of system properties you want to to pass to the database.
|
protected String |
url
Specifies the database URL you want to use to execute Liquibase.
|
protected String |
username
Specifies the database username for database connection.
|
protected boolean |
verbose
Controls the amount of output detail when you call the plugin.
|
protected org.apache.maven.artifact.manager.WagonManager |
wagonManager
The Maven Wagon manager to use when obtaining server authentication details.
|
| Constructor and Description |
|---|
AbstractLiquibaseMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkRequiredParametersAreSpecified()
Performs some validation after the properties file has been loaded checking that all
properties required have been specified.
|
protected void |
cleanup(Database db) |
protected void |
configureChangeLogProperties() |
void |
configureFieldsAndValues() |
protected Liquibase |
createLiquibase(Database db) |
boolean |
databaseConnectionRequired()
Optionally, an implementation of this mojo can override this to indicate that a connection to the database
is not required.
|
void |
execute() |
protected ClassLoader |
getClassLoaderIncludingProjectClasspath()
Returns an isolated classloader.
|
protected Field |
getField(Class clazz,
String name) |
protected String |
getLicenseKey()
Get the specified license key.
|
protected Liquibase |
getLiquibase() |
protected ClassLoader |
getMavenArtifactClassLoader() |
protected Writer |
getOutputWriter(File outputFile) |
protected ResourceAccessor |
getResourceAccessor(ClassLoader cl) |
protected boolean |
isPromptOnNonLocalDatabase()
Deprecated.
no longer prompts
|
protected void |
parsePropertiesFile(InputStream propertiesInputStream)
Parses a properties file and sets the associated fields in the plugin.
|
protected abstract void |
performLiquibaseTask(Liquibase liquibase) |
protected void |
printSettings(String indent)
Prints the settings that have been set of defaulted for the plugin.
|
protected void |
setupBindInfoPackage() |
@PropertyElement protected Boolean preserveSchemaCase
@PropertyElement protected String driver
@PropertyElement protected String url
protected org.apache.maven.artifact.manager.WagonManager wagonManager
@PropertyElement protected String username
@PropertyElement protected String password
@PropertyElement protected boolean emptyPassword
password setting.@PropertyElement protected boolean outputDefaultSchema
@PropertyElement protected boolean outputDefaultCatalog
@PropertyElement protected String defaultCatalogName
@PropertyElement protected String defaultSchemaName
@PropertyElement protected String databaseClass
@PropertyElement protected String propertyProviderClass
@PropertyElement protected boolean promptOnNonLocalDatabase
@PropertyElement protected boolean includeArtifact
@PropertyElement protected boolean includeTestOutputDirectory
@PropertyElement protected boolean verbose
@PropertyElement protected String logging
@PropertyElement protected String propertyFile
@PropertyElement protected boolean propertyFileWillOverride
@PropertyElement protected boolean clearCheckSums
@PropertyElement protected Properties systemProperties
protected org.apache.maven.project.MavenProject project
@PropertyElement protected boolean skip
@PropertyElement protected String outputFileEncoding
@PropertyElement protected String changelogCatalogName
@PropertyElement protected String changelogSchemaName
@PropertyElement protected String databaseChangeLogTableName
@PropertyElement protected String databaseChangeLogLockTableName
@PropertyElement protected boolean showBanner
protected String commandName
protected String getLicenseKey()
protected Writer getOutputWriter(File outputFile) throws IOException
IOExceptionpublic void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected Field getField(Class clazz, String name) throws NoSuchFieldException
NoSuchFieldExceptionprotected Liquibase getLiquibase()
protected void setupBindInfoPackage()
protected abstract void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException
LiquibaseExceptionprotected boolean isPromptOnNonLocalDatabase()
protected Liquibase createLiquibase(Database db) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void configureFieldsAndValues()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void configureChangeLogProperties()
throws org.apache.maven.plugin.MojoFailureException,
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionprotected ClassLoader getMavenArtifactClassLoader() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected ClassLoader getClassLoaderIncludingProjectClasspath() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected ResourceAccessor getResourceAccessor(ClassLoader cl)
protected void checkRequiredParametersAreSpecified()
throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException - If any property that is required has not been
specified.public boolean databaseConnectionRequired()
protected void printSettings(String indent)
indent - The indent string to use when printing the settings.protected void cleanup(Database db)
protected void parsePropertiesFile(InputStream propertiesInputStream) throws org.apache.maven.plugin.MojoExecutionException
propertiesInputStream - The input stream which is the Liquibase properties that
needs to be parsed.org.apache.maven.plugin.MojoExecutionException - If there is a problem parsing
the file.Copyright © 2022 Liquibase.org. All rights reserved.