Class LiquibaseRollback

java.lang.Object
org.apache.maven.plugin.AbstractMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
LiquibaseFutureRollbackSQL, LiquibaseRollbackSQL

public class LiquibaseRollback extends AbstractLiquibaseChangeLogMojo

Invokes Liquibase to rollback the database (and mark changesets as unapplied). The changesets to be rolled back are specified using attributes 'rollbackCount', 'rollbackTag' and/or 'rollbackDate'

  • Field Details

    • rollbackTag

      protected String rollbackTag
      The tag to roll the database back to.
    • rollbackCount

      protected int rollbackCount
      The number of changesets to rollback.
    • rollbackDate

      protected String rollbackDate
      The date to rollback the database to. The format of the date must match either an ISO date format, or that of the DateFormat.getDateInstance() for the platform the plugin is executing on.
    • type

      The type of the rollback that is being performed.
    • rollbackScript

      protected String rollbackScript
      External script containing rollback logic. Set to override the rollback logic contained in the changelog
  • Constructor Details

    • LiquibaseRollback

      public LiquibaseRollback()
  • Method Details

    • 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.
    • checkRequiredRollbackParameters

      protected void checkRequiredRollbackParameters() throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException
    • 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.
    • performLiquibaseTask

      protected void performLiquibaseTask(liquibase.Liquibase liquibase) throws liquibase.exception.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:
      liquibase.exception.LiquibaseException
    • parseDate

      protected Date parseDate(String date) throws ParseException
      Throws:
      ParseException