Coverage Report - org.liquibase.maven.plugins.LiquibaseUpdate
 
Classes in this File Line Coverage Branch Coverage Complexity
LiquibaseUpdate
10%
1/10
0%
0/4
2
 
 1  
 package org.liquibase.maven.plugins;
 2  
 
 3  
 import liquibase.exception.LiquibaseException;
 4  
 import liquibase.Liquibase;
 5  
 
 6  
 /**
 7  
  * Applies the DatabaseChangeLogs to the database. Useful as part of the build process.
 8  
  * 
 9  
  * @author Peter Murray
 10  
  * @description Liquibase Update Maven plugin
 11  
  * @goal update
 12  
  */
 13  4
 public class LiquibaseUpdate extends AbstractLiquibaseUpdateMojo {
 14  
 
 15  
     /**
 16  
      * Whether or not to perform a drop on the database before executing the change.
 17  
      * 
 18  
      * @parameter expression="${liquibase.dropFirst}" default-value="false"
 19  
      */
 20  
     protected boolean dropFirst;
 21  
 
 22  
     @Override
 23  
     protected void doUpdate(Liquibase liquibase) throws LiquibaseException {
 24  0
         if (dropFirst) {
 25  0
             liquibase.dropAll();
 26  
         }
 27  
 
 28  0
         if (changesToApply > 0) {
 29  0
             liquibase.update(changesToApply, contexts);
 30  
         } else {
 31  0
             liquibase.update(contexts);
 32  
         }
 33  0
     }
 34  
 
 35  
     @Override
 36  
     protected void printSettings(String indent) {
 37  0
         super.printSettings(indent);
 38  0
         getLog().info(indent + "drop first? " + dropFirst);
 39  
 
 40  0
     }
 41  
 }