impex:datasql

Full name:

org.kuali.maven.plugins:maven-impex-plugin:1.1.13:datasql

Description:

Generates platform specific SQL from database agnostic XML files. Each SQL file created by this goal contains data for a single table. The database platform to generate SQL for is determined by ${targetDatabase}. See also impex:schemasql

Attributes:

  • Requires a Maven project to be executed.
  • Binds by default to the lifecycle phase: generate-sources.

Required Parameters

Name Type Since Description
dataDTD File - The DTD for the data XML files
Default value is: ${project.build.directory}/generated-impex/${project.artifactId}.dtd.
User property is: dataDTD.
dataXMLDir File - The directory containing data XML files
Default value is: ${basedir}/src/main/impex.
User property is: dataXMLDir.
dataXMLIncludes String - The default set of files in that directory to include (ant style notation)
Default value is: *.xml.
User property is: dataXMLIncludes.
dummy String - The directory in which the SQL will be generated.
Default value is: ${project.build.directory}/classes/sql.
User property is: outputDir.
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.
User property is: forceMojoExecution.
runOnlyOnChange boolean - Only run this mojo if the data or schema has changed since the last run
Default value is: true.
User property is: runOnlyOnChange.
schemaDir String - The path to the directory where the schema XML files are located
Default value is: ${basedir}/src/main/impex.
User property is: schemaDir.
schemaIncludes String - The schema files from that directory which should be included (ant-style notation).
Default value is: ${project.artifactId}.xml.
User property is: schemaIncludes.
schemaXMLFile File - The XML file describing the database schema
Default value is: ${basedir}/src/main/impex/${project.artifactId}.xml.
User property is: schemaXMLFile.

Optional Parameters

Name Type Since Description
dataXMLExcludes String - The default set of files in that directory to exclude (ant style notation)
Default value is: ${project.artifactId}.xml.
User property is: dataXMLExcludes.
dummy2 String - The location where the SQL file will be generated.
Default value is: ../../../reports/report.${project.artifactId}-data.sql.
User property is: reportFile.
dummy3 String - The location where the context property file for velocity will be generated.
Default value is: ${project.build.directory}/reports/context.datasql.properties.
User property is: contextPropertiesPath.
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}.
User property is: encoding.
runOnlyOnSchemaChange boolean - Determines if this task should run only if the schema has changed
Default value is: true.
User property is: runOnlyOnSchemaChange.
skip boolean - When true, skip the execution of this mojo
Default value is: false.
sqlDbMap String - The path to the properties file containing the mapping sql file -> target database.
Default value is: ${project.build.directory}/reports/sqldbmap.properties.
User property is: sqlDbMap.
startMavenLogger boolean - When true, redirect logging from Log4j and Jakarta Commons Logging to the Maven logging system
Default value is: true.
User property is: startMavenLogger.
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.
User property is: targetDatabase.
targetPackage String - The target package for the generated classes.
Default value is: impex.generated.
User property is: targetPackage.
templatePath String - The base path where the templates are read from, if they are not read from the classpath.
Default value is: ${basedir}/src/main/impex/templates.
User property is: templatePath.
url String - Database URL.
User property is: url.
useClasspath boolean - Whether the templates should be loaded from the classpath.
Default value is: true.
User property is: useClasspath.
userContextProperties Map - A map where all user-defined context properties can be set. Overrides all other mojo configuration settings which are mapped to context properties.

Parameter Details

dataDTD:

The DTD for the data XML files
  • Type: java.io.File
  • Required: Yes
  • User Property: dataDTD
  • Default: ${project.build.directory}/generated-impex/${project.artifactId}.dtd

dataXMLDir:

The directory containing data XML files
  • Type: java.io.File
  • Required: Yes
  • User Property: dataXMLDir
  • Default: ${basedir}/src/main/impex

dataXMLExcludes:

The default set of files in that directory to exclude (ant style notation)
  • Type: java.lang.String
  • Required: No
  • User Property: dataXMLExcludes
  • Default: ${project.artifactId}.xml

dataXMLIncludes:

The default set of files in that directory to include (ant style notation)
  • Type: java.lang.String
  • Required: Yes
  • User Property: dataXMLIncludes
  • Default: *.xml

dummy:

The directory in which the SQL will be generated.
  • Type: java.lang.String
  • Required: Yes
  • User Property: outputDir
  • Default: ${project.build.directory}/classes/sql

dummy2:

The location where the SQL file will be generated.
  • Type: java.lang.String
  • Required: No
  • User Property: reportFile
  • Default: ../../../reports/report.${project.artifactId}-data.sql

dummy3:

The location where the context property file for velocity will be generated.
  • Type: java.lang.String
  • Required: No
  • User Property: contextPropertiesPath
  • Default: ${project.build.directory}/reports/context.datasql.properties

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
  • User Property: encoding
  • Default: ${project.build.sourceEncoding}

forceMojoExecution:

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

runOnlyOnChange:

Only run this mojo if the data or schema has changed since the last run
  • Type: boolean
  • Required: Yes
  • User Property: runOnlyOnChange
  • Default: true

runOnlyOnSchemaChange:

Determines if this task should run only if the schema has changed
  • Type: boolean
  • Required: No
  • User Property: runOnlyOnSchemaChange
  • Default: true

schemaDir:

The path to the directory where the schema XML files are located
  • Type: java.lang.String
  • Required: Yes
  • User Property: schemaDir
  • Default: ${basedir}/src/main/impex

schemaIncludes:

The schema files from that directory which should be included (ant-style notation).
  • Type: java.lang.String
  • Required: Yes
  • User Property: schemaIncludes
  • Default: ${project.artifactId}.xml

schemaXMLFile:

The XML file describing the database schema
  • Type: java.io.File
  • Required: Yes
  • User Property: schemaXMLFile
  • Default: ${basedir}/src/main/impex/${project.artifactId}.xml

skip:

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

sqlDbMap:

The path to the properties file containing the mapping sql file -> target database.
  • Type: java.lang.String
  • Required: No
  • User Property: sqlDbMap
  • Default: ${project.build.directory}/reports/sqldbmap.properties

startMavenLogger:

When true, redirect logging from Log4j and Jakarta Commons Logging to the Maven logging system
  • Type: boolean
  • Required: No
  • User Property: 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
  • User Property: targetDatabase

targetPackage:

The target package for the generated classes.
  • Type: java.lang.String
  • Required: No
  • User Property: targetPackage
  • Default: impex.generated

templatePath:

The base path where the templates are read from, if they are not read from the classpath.
  • Type: java.lang.String
  • Required: No
  • User Property: templatePath
  • Default: ${basedir}/src/main/impex/templates

url:

Database URL.
  • Type: java.lang.String
  • Required: No
  • User Property: url

useClasspath:

Whether the templates should be loaded from the classpath.
  • Type: boolean
  • Required: No
  • User Property: useClasspath
  • Default: true

userContextProperties:

A map where all user-defined context properties can be set. Overrides all other mojo configuration settings which are mapped to context properties.
  • Type: java.util.Map
  • Required: No