Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AbstractLiquibaseUpdateMojo |
|
| 1.0;1 |
1 | package org.liquibase.maven.plugins; | |
2 | ||
3 | import liquibase.exception.LiquibaseException; | |
4 | import liquibase.Liquibase; | |
5 | ||
6 | /** | |
7 | * Liquibase Update Maven plugin. This plugin allows for DatabaseChangeLogs to be applied to a database as part of a | |
8 | * Maven build process. | |
9 | * | |
10 | * @author Peter Murray | |
11 | * @description Liquibase Update Maven plugin | |
12 | */ | |
13 | 4 | public abstract class AbstractLiquibaseUpdateMojo extends AbstractLiquibaseChangeLogMojo { |
14 | ||
15 | /** | |
16 | * The number of changes to apply to the database. By default this value is 0, which will result in all changes (not | |
17 | * already applied to the database) being applied. | |
18 | * | |
19 | * @parameter expression="${liquibase.changesToApply}" default-value=0 | |
20 | */ | |
21 | protected int changesToApply; | |
22 | ||
23 | @Override | |
24 | protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException { | |
25 | 0 | super.performLiquibaseTask(liquibase); |
26 | 0 | doUpdate(liquibase); |
27 | 0 | } |
28 | ||
29 | /** | |
30 | * Performs the actual "update" work on the database. | |
31 | * | |
32 | * @param liquibase | |
33 | * The Liquibase object to use to perform the "update". | |
34 | */ | |
35 | protected abstract void doUpdate(Liquibase liquibase) throws LiquibaseException; | |
36 | ||
37 | @Override | |
38 | protected void printSettings(String indent) { | |
39 | 0 | super.printSettings(indent); |
40 | 0 | getLog().info(indent + "number of changes to apply: " + changesToApply); |
41 | 0 | } |
42 | } |