org.dbmaintain.maven.plugin
Class CheckScriptUpdatesMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.dbmaintain.maven.plugin.BaseMojo
          extended by org.dbmaintain.maven.plugin.BaseDatabaseMojo
              extended by org.dbmaintain.maven.plugin.CheckScriptUpdatesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class CheckScriptUpdatesMojo
extends BaseDatabaseMojo

Performs a dry run of the database update. May be used to verify if there are any updates or in a test that fails if it appears that an irregular script update was performed.

Author:
Tim Ducheyne, tiwe

Field Summary
protected  Boolean allowOutOfSequenceExecutionOfPatches
          If this property is set to true, a patch script is allowed to be executed even if another script with a higher index was already executed.
protected  Boolean autoCreateDbMaintainScriptsTable
          Sets the autoCreateDbMaintainScriptsTable property.
protected  String excludedQualifiers
          Optional comma-separated list of script qualifiers.
protected  Boolean fromScratchEnabled
          Sets the fromScratchEnabled property, that indicates the database can be recreated from scratch if needed.
protected  String includedQualifiers
          Optional comma-separated list of script qualifiers.
protected  String patchQualifiers
          The qualifier to use to determine whether a script is a patch script.
protected  String postProcessingScriptDirectoryName
          Comma separated list of directories and files in which the post processing database scripts are located.
protected  String qualifiers
          Optional comma-separated list of script qualifiers.
protected  List<ScriptArchiveDependency> scriptArchiveDependencies
          Defines where the scripts can be found that must be executed on the database.
protected  String scriptEncoding
          Encoding to use when reading the script files.
protected  String scriptFileExtensions
          Sets the scriptFileExtensions property, that defines the extensions of the files that are regarded to be database scripts.
protected  String scriptLocations
          Defines where the scripts can be found that must be executed on the database.
protected  Boolean useLastModificationDates
          Defines whether the last modification dates of the scripts files can be used to determine whether the contents of a script has changed.
 
Fields inherited from class org.dbmaintain.maven.plugin.BaseDatabaseMojo
databases
 
Fields inherited from class org.dbmaintain.maven.plugin.BaseMojo
artifactFactory, configFile, localRepository, mavenProjectHelper, project, remoteRepositories, resolver
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
CheckScriptUpdatesMojo()
           
 
Method Summary
protected  DbMaintainTask createDbMaintainTask(List<DbMaintainDatabase> dbMaintainDatabases)
           
 
Methods inherited from class org.dbmaintain.maven.plugin.BaseDatabaseMojo
createDbMaintainTask, getAllScriptLocations, getDbMaintainDatabases
 
Methods inherited from class org.dbmaintain.maven.plugin.BaseMojo
execute, getMavenProperties, performAfterTaskActions
 
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

scriptArchiveDependencies

protected List<ScriptArchiveDependency> scriptArchiveDependencies
Defines where the scripts can be found that must be executed on the database. Multiple dependencies may be configured. At least one scriptArchiveDependency or scriptLocation (can be both) must be defined.


scriptLocations

protected String scriptLocations
Defines where the scripts can be found that must be executed on the database. Multiple locations may be configured, separated by comma's. A script location can be a folder or a jar file. This property is required. At least one scriptArchiveDependency or scriptLocation (can be both) must be defined.


scriptEncoding

protected String scriptEncoding
Encoding to use when reading the script files. Defaults to ISO-8859-1


postProcessingScriptDirectoryName

protected String postProcessingScriptDirectoryName
Comma separated list of directories and files in which the post processing database scripts are located. Directories in this list are recursively search for files. Defaults to postprocessing


fromScratchEnabled

protected Boolean fromScratchEnabled
Sets the fromScratchEnabled property, that indicates the database can be recreated from scratch if needed. From-scratch recreation is needed in following cases: If set to false, DbMaintain will give an error if one of these situations occurs. The default is false.


autoCreateDbMaintainScriptsTable

protected Boolean autoCreateDbMaintainScriptsTable
Sets the autoCreateDbMaintainScriptsTable property. If set to true, the table DBMAINTAIN_SCRIPTS will be created automatically if it does not exist yet. If false, an exception is thrown, indicating how to create the table manually. False by default.


allowOutOfSequenceExecutionOfPatches

protected Boolean allowOutOfSequenceExecutionOfPatches
If this property is set to true, a patch script is allowed to be executed even if another script with a higher index was already executed.


qualifiers

protected String qualifiers
Optional comma-separated list of script qualifiers. All custom qualifiers that are used in script file names must be declared.


patchQualifiers

protected String patchQualifiers
The qualifier to use to determine whether a script is a patch script. Defaults to patch. E.g. 01_#patch_myscript.sql


includedQualifiers

protected String includedQualifiers
Optional comma-separated list of script qualifiers. All included qualifiers must be registered using the qualifiers property. Only scripts which are qualified with one of the included qualifiers will be executed.


excludedQualifiers

protected String excludedQualifiers
Optional comma-separated list of script qualifiers. All excluded qualifiers must be registered using the qualifiers property. Scripts qualified with one of the excluded qualifiers will not be executed.


scriptFileExtensions

protected String scriptFileExtensions
Sets the scriptFileExtensions property, that defines the extensions of the files that are regarded to be database scripts. The extensions should not start with a dot. The default is 'sql,ddl'.


useLastModificationDates

protected Boolean useLastModificationDates
Defines whether the last modification dates of the scripts files can be used to determine whether the contents of a script has changed. If set to true, DbMaintain will not look at the contents of scripts that were already executed on the database, if the last modification date is still the same. If it did change, it will first calculate the checksum of the file to verify that the content really changed. Setting this property to true improves performance: if set to false the checksum of every script must be calculated for each run. True by default.

Constructor Detail

CheckScriptUpdatesMojo

public CheckScriptUpdatesMojo()
Method Detail

createDbMaintainTask

protected DbMaintainTask createDbMaintainTask(List<DbMaintainDatabase> dbMaintainDatabases)
Specified by:
createDbMaintainTask in class BaseDatabaseMojo


Copyright © 2011. All Rights Reserved.