impex:import

Full name:

org.kuali.db.impex:maven-impex-plugin:1.0.21-SNAPSHOT:import

Description:

Executes SQL for creating tables, primary keys, constraints, indexes, relationships, and views inside a database. Also populates the tables with a default set of data.

Attributes:

  • Requires a Maven 2.0 project to be executed.

Required Parameters

Name Type Since Description
forceMojoExecution boolean - Setting this parameter to true will force the execution of this mojo, even if it would get skipped usually.
Default value is: false.
importDir File - This is the directory to scan for SQL files to import. ${targetDatabase} gets appended to this value
Default value is: ${project.build.directory}/classes/sql.

Optional Parameters

Name Type Since Description
append boolean - If writing output to a file, append to an existing file or overwrite it?
Default value is: false.
autocommit boolean - Set to true to execute non-transactional SQL.
Default value is: false.
delimiter String - Set the delimiter that separates SQL statements.
Default value is: /.
delimiterType String - The delimiter type takes two values - "normal" and "row". Normal means that any occurrence of the delimiter terminates the SQL command whereas with row, only a line containing just the delimiter is recognized as the end of the command.

For example, set delimiterType to "row" and delimiter to "/" for Oracle
Default value is: row.
driver String - Database driver classname. This parameter is optional, as the correct JDBC driver to use is detected from the url in almost all cases (works for Oracle, MySQL, Derby, PostGresSQL, DB2, H2, HSQL, SQL Server). If a driver is explicitly supplied, it will be used in place of the JDBC driver the automatic detection logic would have chosen.
driverProperties String - Additional key=value pairs separated by a comma to be passed to JDBC driver.
enableAnonymousPassword boolean - Ignore the password and use anonymous access.
Default value is: false.
enableAnonymousUsername boolean - Ignore the username and use anonymous access.
Default value is: false.
encoding String - The encoding to use when reading/writing files. If not specified this defaults to the platform specific encoding of whatever machine the build is running on.
Default value is: ${project.build.sourceEncoding}.
escapeProcessing boolean - Argument to Statement.setEscapeProcessing If you want the driver to use regular SQL syntax then set this to false.
Default value is: true.
importDirExcludes String - (no description)
importDirIncludes String - (no description)
Default value is: *.sql.
keepFormat boolean - Keep the format of an SQL block.
Default value is: true.
onError String - Action to perform if an error is found. Possible values are abort and continue.
Default value is: abort.
order String - Set the order in which the SQL files will be executed. Possible values are ASCENDING and DESCENDING and NONE. Default value is ASCENDING
password String - Database password. If not given, it will be looked up through settings.xml's server with ${settingsKey} as key.
settingsKey String - The id of the server in settings.xml containing the username/password to use.
Default value is: impex.${project.artifactId}.
showPassword boolean - If set to true the password being used to connect to the database will be displayed in log messages.
Default value is: false.
showheaders boolean - Print header columns.
Default value is: true.
skip boolean - When true, skip the execution of this mojo
Default value is: false.
skipOnConnectionError boolean - Skip execution if there is an error obtaining a connection. If this is set to true, the build will continue even if there is an error obtaining a connection
Default value is: false.
sqlCommand String - SQL input commands separated by ${delimiter}.
srcFiles File[] - List of files containing SQL statements to load.
startMavenLogger boolean - When true, redirect logging from Log4j and Jakarta Commons Logging to the Maven logging system
Default value is: true.
targetDatabase String - The type of database we are targeting (eg oracle, mysql). This is optional if url is supplied as the database type will be automatically detected based on the url. If targetDatabase is explicitly supplied it will override the type selected by the automatic detection logic.
url String - Database URL.
username String - Database username. If not given, it will be looked up through settings.xml's server with ${settingsKey} as key.

Parameter Details

append:

If writing output to a file, append to an existing file or overwrite it?
  • Type: boolean
  • Required: No
  • Expression: ${append}
  • Default: false

autocommit:

Set to true to execute non-transactional SQL.
  • Type: boolean
  • Required: No
  • Expression: ${autocommit}
  • Default: false

delimiter:

Set the delimiter that separates SQL statements.
  • Type: java.lang.String
  • Required: No
  • Expression: ${delimiter}
  • Default: /

delimiterType:

The delimiter type takes two values - "normal" and "row". Normal means that any occurrence of the delimiter terminates the SQL command whereas with row, only a line containing just the delimiter is recognized as the end of the command.

For example, set delimiterType to "row" and delimiter to "/" for Oracle
  • Type: java.lang.String
  • Required: No
  • Expression: ${delimiterType}
  • Default: row

driver:

Database driver classname. This parameter is optional, as the correct JDBC driver to use is detected from the url in almost all cases (works for Oracle, MySQL, Derby, PostGresSQL, DB2, H2, HSQL, SQL Server). If a driver is explicitly supplied, it will be used in place of the JDBC driver the automatic detection logic would have chosen.
  • Type: java.lang.String
  • Required: No
  • Expression: ${driver}

driverProperties:

Additional key=value pairs separated by a comma to be passed to JDBC driver.
  • Type: java.lang.String
  • Required: No
  • Expression: ${driverProperties}

enableAnonymousPassword:

Ignore the password and use anonymous access.
  • Type: boolean
  • Required: No
  • Expression: ${enableAnonymousPassword}
  • Default: false

enableAnonymousUsername:

Ignore the username and use anonymous access.
  • Type: boolean
  • Required: No
  • Expression: ${enableAnonymousUsername}
  • Default: false

encoding:

The encoding to use when reading/writing files. If not specified this defaults to the platform specific encoding of whatever machine the build is running on.
  • Type: java.lang.String
  • Required: No
  • Expression: ${encoding}
  • Default: ${project.build.sourceEncoding}

escapeProcessing:

Argument to Statement.setEscapeProcessing If you want the driver to use regular SQL syntax then set this to false.
  • Type: boolean
  • Required: No
  • Expression: ${escapeProcessing}
  • Default: true

forceMojoExecution:

Setting this parameter to true will force the execution of this mojo, even if it would get skipped usually.
  • Type: boolean
  • Required: Yes
  • Expression: ${forceMojoExecution}
  • Default: false

importDir:

This is the directory to scan for SQL files to import. ${targetDatabase} gets appended to this value
  • Type: java.io.File
  • Required: Yes
  • Expression: ${importDir}
  • Default: ${project.build.directory}/classes/sql

importDirExcludes:

(no description)
  • Type: java.lang.String
  • Required: No
  • Expression: ${importDirExcludes}

importDirIncludes:

(no description)
  • Type: java.lang.String
  • Required: No
  • Expression: ${importDirIncludes}
  • Default: *.sql

keepFormat:

Keep the format of an SQL block.
  • Type: boolean
  • Required: No
  • Expression: ${keepFormat}
  • Default: true

onError:

Action to perform if an error is found. Possible values are abort and continue.
  • Type: java.lang.String
  • Required: No
  • Expression: ${onError}
  • Default: abort

order:

Set the order in which the SQL files will be executed. Possible values are ASCENDING and DESCENDING and NONE. Default value is ASCENDING
  • Type: java.lang.String
  • Required: No
  • Expression: ${order}

password:

Database password. If not given, it will be looked up through settings.xml's server with ${settingsKey} as key.
  • Type: java.lang.String
  • Required: No
  • Expression: ${password}

settingsKey:

The id of the server in settings.xml containing the username/password to use.
  • Type: java.lang.String
  • Required: No
  • Expression: ${settingsKey}
  • Default: impex.${project.artifactId}

showPassword:

If set to true the password being used to connect to the database will be displayed in log messages.
  • Type: boolean
  • Required: No
  • Expression: ${showPassword}
  • Default: false

showheaders:

Print header columns.
  • Type: boolean
  • Required: No
  • Expression: ${showheaders}
  • Default: true

skip:

When true, skip the execution of this mojo
  • Type: boolean
  • Required: No
  • Default: false

skipOnConnectionError:

Skip execution if there is an error obtaining a connection. If this is set to true, the build will continue even if there is an error obtaining a connection
  • Type: boolean
  • Required: No
  • Expression: ${skipOnConnectionError}
  • Default: false

sqlCommand:

SQL input commands separated by ${delimiter}.
  • Type: java.lang.String
  • Required: No
  • Expression: ${sqlCommand}

srcFiles:

List of files containing SQL statements to load.
  • Type: java.io.File[]
  • Required: No
  • Expression: ${srcFiles}

startMavenLogger:

When true, redirect logging from Log4j and Jakarta Commons Logging to the Maven logging system
  • Type: boolean
  • Required: No
  • Expression: ${startMavenLogger}
  • Default: true

targetDatabase:

The type of database we are targeting (eg oracle, mysql). This is optional if url is supplied as the database type will be automatically detected based on the url. If targetDatabase is explicitly supplied it will override the type selected by the automatic detection logic.
  • Type: java.lang.String
  • Required: No
  • Expression: ${targetDatabase}

url:

Database URL.
  • Type: java.lang.String
  • Required: No
  • Expression: ${url}

username:

Database username. If not given, it will be looked up through settings.xml's server with ${settingsKey} as key.
  • Type: java.lang.String
  • Required: No
  • Expression: ${username}