Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 // Version:   $Id: $
 // Copyright: Copyright(c) 2007 Trace Financial Limited
 package org.liquibase.maven.plugins;
 import liquibase.*;
A Liquibase MOJO that requires the user to provide a DatabaseChangeLogFile to be able to perform any actions on the database.

Peter Murray
public abstract class AbstractLiquibaseChangeLogMojo extends AbstractLiquibaseMojo {

Specifies the change log file to use for Liquibase.

  protected String changeLogFile;

The Liquibase contexts to execute, which can be "," separated if multiple contexts are required. If no context is specified then ALL contexts will be executed.

expression="${liquibase.contexts}" default-value=""
  protected String contexts;
  private String contextsDefault = "";
    if ( == null) {
      throw new MojoFailureException("The changeLogFile must be specified.");

Performs the actual Liquibase task on the database using the fully configured liquibase.Liquibase.

liquibase The liquibase.Liquibase that has been fully configured to run the desired database task.
  protected void performLiquibaseTask(Liquibase liquibasethrows LiquibaseException {
  protected void printSettings(String indent) {
    getLog().info(indent + "changeLogFile: " + );
    getLog().info(indent + "context(s): " + );
    ResourceAccessor mFO = new MavenResourceAccessor(cl);
    return new CompositeResourceAccessor(mFOfsFO);
        try {
            String changeLog =  == null ? "" : .trim();
            return new Liquibase(changeLogfodb);
        } catch (LiquibaseException ex) {
            throw new MojoExecutionException("Error creating liquibase: "+ex.getMessage(), ex);
New to GrepCode? Check out our FAQ X