public class LiquibaseTestMojo extends org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
| Modifier and Type | Field and Description |
|---|---|
protected String |
changeLogFile
Deprecated.
|
protected File |
changeLogSavePath |
protected boolean |
clearCheckSums
Flag for forcing the checksums to be cleared from teh DatabaseChangeLog table.
|
protected String |
contexts
The Liquibase contexts to execute, which can be "," separated if multiple contexts
are required.
|
protected String |
databaseClass
The class to use as the database object.
|
static String |
DEFAULT_CHANGELOG_PATH |
static String |
DEFAULT_LBPROP_PATH |
static String |
DEFAULT_UPDATE_FILE |
static String |
DEFAULT_UPDATE_PATH |
protected String |
defaultSchemaName
The default schema name to use the for database connection.
|
protected String |
driver
The fully qualified name of the driver class to use to connect to the database.
|
protected boolean |
includeArtifact
Allows for the maven project artifact to be included in the class loader for
obtaining the Liquibase property and DatabaseChangeLog files.
|
protected boolean |
includeTestOutputDirectory
Allows for the maven test output directory to be included in the class loader for
obtaining the Liquibase property and DatabaseChangeLog files.
|
protected String |
logging
Controls the level of logging from Liquibase when executing.
|
protected String |
password
The database password to use to connect to the specified database.
|
protected org.apache.maven.project.MavenProject |
project
The Maven project that plugin is running under.
|
protected boolean |
promptOnNonLocalDatabase
Controls the prompting of users as to whether or not they really want to run the
changes on a database that is not local to the machine that the user is current
executing the plugin on.
|
protected String |
propertyFile
The Liquibase properties file used to configure the Liquibase
Liquibase. |
protected boolean |
propertyFileWillOverride
Flag allowing for the Liquibase properties file to override any settings provided in
the Maven plugin configuration.
|
protected String |
rollbackTag
The tag to roll the database back to.
|
protected Properties |
systemProperties
List of system properties to pass to the database.
|
static String |
TEST_ROLLBACK_TAG |
protected File |
updatePath
Location of an update.xml
|
protected String |
url
The Database URL to connect to for executing Liquibase.
|
protected String |
username
The database username to use to connect to the specified database.
|
protected boolean |
verbose
Controls the verbosity of the output from invoking the plugin.
|
protected org.apache.maven.artifact.manager.WagonManager |
wagonManager
The Maven Wagon manager to use when obtaining server authentication details.
|
| Constructor and Description |
|---|
LiquibaseTestMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doFieldHack() |
void |
execute() |
protected void |
generateUpdateLog(File changeLogFile,
Collection<File> changelogs) |
protected File |
getBasedir() |
protected Field |
getDeclaredField(Class clazz,
String fieldName)
Recursively searches for the field specified by the fieldName in the class and all
the super classes until it either finds it, or runs out of parents.
|
protected File[] |
getLiquibasePropertiesFiles() |
protected Element |
includeNode(Document parentChangeLog,
File changelog) |
protected void |
parsePropertiesFile(InputStream propertiesInputStream)
Parses a properties file and sets the assocaited fields in the plugin.
|
protected void |
performLiquibaseTask(liquibase.Liquibase liquibase) |
protected Collection<File> |
scanForChangelogs(File searchPath) |
checkRequiredParametersAreSpecified, createLiquibase, getFileOpener, printSettingscleanup, configureFieldsAndValues, getClassLoaderIncludingProjectClasspath, getLiquibase, getMavenArtifactClassLoader, isPromptOnNonLocalDatabasepublic static final String DEFAULT_CHANGELOG_PATH
public static final String DEFAULT_UPDATE_FILE
public static final String DEFAULT_UPDATE_PATH
public static final String DEFAULT_LBPROP_PATH
public static final String TEST_ROLLBACK_TAG
@Parameter(property="liquibase.driver",
required=true)
protected String driver
@Parameter(property="liquibase.url",
required=true)
protected String url
@Component(role=org.apache.maven.artifact.manager.WagonManager.class) protected org.apache.maven.artifact.manager.WagonManager wagonManager
@Parameter(property="liquibase.username",
required=true)
protected String username
@Parameter(property="liquibase.password",
required=true)
protected String password
@Parameter(property="liquibase.defaultSchemaName") protected String defaultSchemaName
@Parameter(property="liquibase.databaseClass",
required=true)
protected String databaseClass
protected boolean promptOnNonLocalDatabase
protected boolean includeArtifact
protected boolean includeTestOutputDirectory
protected boolean verbose
protected String logging
protected String propertyFile
Liquibase.protected boolean propertyFileWillOverride
protected boolean clearCheckSums
protected Properties systemProperties
protected String changeLogFile
protected File changeLogSavePath
@Parameter(property="lb.updatePath",
defaultValue="${project.basedir}/src/main/changelogs")
protected File updatePath
@Parameter(property="liquibase.rollbackTag") protected String rollbackTag
@Parameter(property="project",
required=true)
protected org.apache.maven.project.MavenProject project
public LiquibaseTestMojo()
protected File getBasedir()
protected void doFieldHack()
protected File[] getLiquibasePropertiesFiles() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
execute in interface org.apache.maven.plugin.Mojoexecute in class org.liquibase.maven.plugins.AbstractLiquibaseMojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void performLiquibaseTask(liquibase.Liquibase liquibase) throws liquibase.exception.LiquibaseException
performLiquibaseTask in class org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojoliquibase.exception.LiquibaseExceptionprotected void parsePropertiesFile(InputStream propertiesInputStream) throws org.apache.maven.plugin.MojoExecutionException
parsePropertiesFile in class org.liquibase.maven.plugins.AbstractLiquibaseMojopropertiesInputStream - 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.protected Field getDeclaredField(Class clazz, String fieldName) throws NoSuchFieldException
clazz - The Class to start searching from.fieldName - The name of the field to retrieve.Field identified by the field name.NoSuchFieldException - If the field was not found in the class or any of its
super classes.protected Collection<File> scanForChangelogs(File searchPath)
protected void generateUpdateLog(File changeLogFile, Collection<File> changelogs) throws FileNotFoundException, IOException
FileNotFoundExceptionIOExceptionprotected Element includeNode(Document parentChangeLog, File changelog) throws IOException
IOExceptionCopyright © 2004-2012 Kualigan. All Rights Reserved.