org.liquibase.maven.plugins
Class LiquibaseDatabaseDiff

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.liquibase.maven.plugins.AbstractLiquibaseMojo
          extended by org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
              extended by org.liquibase.maven.plugins.LiquibaseDatabaseDiff
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class LiquibaseDatabaseDiff
extends AbstractLiquibaseChangeLogMojo

Generates a diff between the specified database and the reference database.

Author:
Peter Murray

Field Summary
protected  String diffChangeLogFile
          The diff change log file to output the differences to.
protected  String referenceDefaultSchemaName
          The reference database password to use to connect to the specified database.
protected  String referenceDriver
          The fully qualified name of the driver class to use to connect to the reference database.
protected  String referencePassword
          The reference database password to use to connect to the specified database.
protected  String referenceUrl
          The reference database URL to connect to for executing Liquibase.
protected  String referenceUsername
          The reference database username to use to connect to the specified database.
 
Fields inherited from class org.liquibase.maven.plugins.AbstractLiquibaseChangeLogMojo
changeLogFile, contexts
 
Fields inherited from class org.liquibase.maven.plugins.AbstractLiquibaseMojo
clearCheckSums, databaseClass, defaultSchemaName, driver, emptyPassword, includeArtifact, includeTestOutputDirectory, logging, password, project, promptOnNonLocalDatabase, propertyFile, propertyFileWillOverride, skip, systemProperties, url, username, verbose, wagonManager
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
LiquibaseDatabaseDiff()
           
 
Method Summary
protected  void checkRequiredParametersAreSpecified()
          Performs some validation after the properties file has been loaded checking that all properties required have been specified.
 void execute()
           
protected  boolean isPromptOnNonLocalDatabase()
           
protected  void performLiquibaseTask(Liquibase liquibase)
          Performs the actual Liquibase task on the database using the fully configured 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.AbstractLiquibaseChangeLogMojo
createLiquibase, getFileOpener
 
Methods inherited from class org.liquibase.maven.plugins.AbstractLiquibaseMojo
cleanup, configureFieldsAndValues, getLiquibase, getMavenArtifactClassLoader, parsePropertiesFile
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

referenceDriver

protected String referenceDriver
The fully qualified name of the driver class to use to connect to the reference database. If this is not specified, then the AbstractLiquibaseMojo.driver will be used instead.


referenceUrl

protected String referenceUrl
The reference database URL to connect to for executing Liquibase. If performing a diff against a Hibernate config xml file, then use "hibernate:PATH_TO_CONFIG_XML" as the URL. The path to the hibernate configuration file can be relative to the test classpath for the Maven project.


referenceUsername

protected String referenceUsername
The reference database username to use to connect to the specified database.


referencePassword

protected String referencePassword
The reference database password to use to connect to the specified database. If this is null then an empty password will be used.


referenceDefaultSchemaName

protected String referenceDefaultSchemaName
The reference database password to use to connect to the specified database. If this is null then an empty password will be used.


diffChangeLogFile

protected String diffChangeLogFile
The diff change log file to output the differences to. If this is null then the differences will be output to the screen.

Constructor Detail

LiquibaseDatabaseDiff

public LiquibaseDatabaseDiff()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Specified by:
execute in interface org.apache.maven.plugin.Mojo
Overrides:
execute in class AbstractLiquibaseMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

performLiquibaseTask

protected void performLiquibaseTask(Liquibase liquibase)
                             throws LiquibaseException
Description copied from class: AbstractLiquibaseChangeLogMojo
Performs the actual Liquibase task on the database using the fully configured Liquibase.

Overrides:
performLiquibaseTask in class AbstractLiquibaseChangeLogMojo
Parameters:
liquibase - The Liquibase 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 class AbstractLiquibaseChangeLogMojo
Parameters:
indent - The indent string to use when printing the settings.

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 class AbstractLiquibaseChangeLogMojo
Throws:
org.apache.maven.plugin.MojoFailureException - If any property that is required has not been specified.

isPromptOnNonLocalDatabase

protected boolean isPromptOnNonLocalDatabase()
Overrides:
isPromptOnNonLocalDatabase in class AbstractLiquibaseMojo


Copyright © 2004-2011 Liquibase.org. All Rights Reserved.