db:prepareDB

Full name:

ch.elca.el4j.maven.plugins:maven-database-plugin:3.1:prepareDB

Description:

DEPRECATED This class is a convenience mojo that includes the 'start', 'silentDrop' and 'create' mojo.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Requires dependency resolution of artifacts in scope: test.

Required Parameters

Name Type Since Description
toolsPath String - Directory of tools (such as application servers or local dbs) in the project.

Optional Parameters

Name Type Since Description
blockDelimiter String - Separator for sql blocks (e.g. PL/SQL).
Default value is: /.
connectionPropertiesDir String - Base path (in classpath*:)where properties files can be found.
Default value is: scenarios/db/raw/.
connectionPropertiesSource String - Path to properties file where connection properties (username, password and url)can be found. The path can be specified relative to the current directory. In this case it has to start with './' or '../' otherwise it is assumed to be a classpath resource. For classpath resources, no prefix classpath*: is needed. Moreover it can include a generic {db.name} if a env.properties file is provided (in the project dir).
connectionPropertiesSourceTemplate String - Template for filenames for .properties files used to read the connection settings of the database. You can use the variables {groupId}, {artifactId}, {version} and {db.name} eg. {artifactId}-override-{db.name}.properties (this is the default-value)
Default value is: {artifactId}-override-{db.name}.properties.
delimiter String - Separator for sql statements.
Default value is: ;.
driverPropertiesSource String - Path to properties file where JDBC driver name can be found. For this property, no prefix classpath*: is needed. Moreover it can include a generic {db.name} if a env.properties file is provided (in the project dir).
Default value is: scenarios/db/raw/module-database-override-{db.name}.properties.
dryRun boolean - Should db plugin run in dry mode (i.e. no changes to database)?
Default value is: false.
environmentBeanPropertyPropertiesPath String - Base path (in classpath*:)where properties files can be found.
Default value is: classpath*:env-bean-property.properties.
separator String - Separator for string lists.
Default value is: ,.
skip boolean - (no description)
Default value is: false.
sortFilesAscending boolean - Determines whether sql files inside a module should be sorted ascending or descending (in the view of create scripts; drop scripts will be executed in reverse order).

Example for sortFilesAscending == true:
create-1.sql, create-2.sql, create-A.sql, create-B.sql
drop-B.sql, drop-A.sql, drop-2.sql, drop-1.sql

Example for sortFilesAscending == false:
create-B.sql, create-A.sql, create-2.sql, create-1.sql
drop-1.sql, drop-2.sql, drop-A.sql, drop-B.sql


Default value is: true.
sqlFindReplacePattern String - The find-replace pattern to apply to content of each SQL file. The syntax is similar to the unix tool 'sed': the first character is used as delimiter for all tokens. Syntax: '#findRegex#replace#anotherFindRegex#anotherReplace#' and so on.
sqlSourceDir String - SQL Source Directories, i.e. directories where to find the .sql files. By convention these are classpath*:/etc/sql/general/ for sql files used by both database types and classpath*:/etc/sql/{db.name}/ for those sql files that are specific. Note: if you use a non-default separator in your project you have to state this parameter explicitly as well as it uses the default separator in its default value.
Default value is: /etc/sql/general/, /etc/sql/{db.name}/.
wait boolean - Decides whether to wait after the container is started or to return the execution flow to the user.
Default value is: true.

Parameter Details

blockDelimiter:

Separator for sql blocks (e.g. PL/SQL).
  • Type: java.lang.String
  • Required: No
  • Expression: ${blockDelimiter}
  • Default: /

connectionPropertiesDir:

Base path (in classpath*:)where properties files can be found.
  • Type: java.lang.String
  • Required: No
  • Expression: ${db.connectionPropertiesDir}
  • Default: scenarios/db/raw/

connectionPropertiesSource:

Path to properties file where connection properties (username, password and url)can be found. The path can be specified relative to the current directory. In this case it has to start with './' or '../' otherwise it is assumed to be a classpath resource. For classpath resources, no prefix classpath*: is needed. Moreover it can include a generic {db.name} if a env.properties file is provided (in the project dir).
  • Type: java.lang.String
  • Required: No
  • Expression: ${db.connectionPropertiesSource}

connectionPropertiesSourceTemplate:

Template for filenames for .properties files used to read the connection settings of the database. You can use the variables {groupId}, {artifactId}, {version} and {db.name} eg. {artifactId}-override-{db.name}.properties (this is the default-value)
  • Type: java.lang.String
  • Required: No
  • Expression: ${db.connectionPropertiesSourceTemplate}
  • Default: {artifactId}-override-{db.name}.properties

delimiter:

Separator for sql statements.
  • Type: java.lang.String
  • Required: No
  • Expression: ${delimiter}
  • Default: ;

driverPropertiesSource:

Path to properties file where JDBC driver name can be found. For this property, no prefix classpath*: is needed. Moreover it can include a generic {db.name} if a env.properties file is provided (in the project dir).
  • Type: java.lang.String
  • Required: No
  • Expression: ${db.driverPropertiesSource}
  • Default: scenarios/db/raw/module-database-override-{db.name}.properties

dryRun:

Should db plugin run in dry mode (i.e. no changes to database)?
  • Type: boolean
  • Required: No
  • Expression: ${db.dryRun}
  • Default: false

environmentBeanPropertyPropertiesPath:

Base path (in classpath*:)where properties files can be found.
  • Type: java.lang.String
  • Required: No
  • Expression: ${db.environmentBeanPropertyPropertiesPath}
  • Default: classpath*:env-bean-property.properties

separator:

Separator for string lists.
  • Type: java.lang.String
  • Required: No
  • Expression: ${separator}
  • Default: ,

skip:

(no description)
  • Type: boolean
  • Required: No
  • Expression: ${skip}
  • Default: false

sortFilesAscending:

Determines whether sql files inside a module should be sorted ascending or descending (in the view of create scripts; drop scripts will be executed in reverse order).

Example for sortFilesAscending == true:
create-1.sql, create-2.sql, create-A.sql, create-B.sql
drop-B.sql, drop-A.sql, drop-2.sql, drop-1.sql

Example for sortFilesAscending == false:
create-B.sql, create-A.sql, create-2.sql, create-1.sql
drop-1.sql, drop-2.sql, drop-A.sql, drop-B.sql

  • Type: boolean
  • Required: No
  • Expression: ${sortFilesAscending}
  • Default: true

sqlFindReplacePattern:

The find-replace pattern to apply to content of each SQL file. The syntax is similar to the unix tool 'sed': the first character is used as delimiter for all tokens. Syntax: '#findRegex#replace#anotherFindRegex#anotherReplace#' and so on.
  • Type: java.lang.String
  • Required: No
  • Expression: ${db.sqlFindReplacePattern}

sqlSourceDir:

SQL Source Directories, i.e. directories where to find the .sql files. By convention these are classpath*:/etc/sql/general/ for sql files used by both database types and classpath*:/etc/sql/{db.name}/ for those sql files that are specific. Note: if you use a non-default separator in your project you have to state this parameter explicitly as well as it uses the default separator in its default value.
  • Type: java.lang.String
  • Required: No
  • Expression: ${db.sqlSourceDir}
  • Default: /etc/sql/general/, /etc/sql/{db.name}/

toolsPath:

Directory of tools (such as application servers or local dbs) in the project.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${el4j.project.tools}

wait:

Decides whether to wait after the container is started or to return the execution flow to the user.
  • Type: boolean
  • Required: No
  • Expression: ${db.wait}
  • Default: true