jibx:schema-codegen

Full name:

org.jibx:maven-jibx-plugin:1.3.1:schema-codegen

Description:

Generates Java sources from XSD schemas.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • Binds by default to the lifecycle phase: generate-sources.

Required Parameters

Name Type Since Description
multimodule boolean - Control flag multi-module mode.
Default value is: false.
User property is: multi-module.
verbose boolean - Control flag for verbose processing reports.
Default value is: false.
User property is: verbose.

Optional Parameters

Name Type Since Description
baseBindingDirectory String - Get the default location of the base binding files.
Defaults value is: schemaBindingDirectory.
User property is: baseBindingDirectory.
customizations ArrayList - Include pattern for customization files.
User property is: customizations.
defaultNamespace String - Namespace applied in code generation when no-namespaced schema definitions are found (to generate no-namespaced schemas as though they were included in a particular namespace)
defaultPackage String - Default package for code generated from schema definitions with no namespace.
directory String - Deprecated. - Since binding and codegen use this for different directories, use schemaLocation. Defaults to "src/main/config" (or "src/test/config" for test cases).
User property is: directory.
excludeSchemaBindings ArrayList - Exclude pattern for schema binding files.
User property is: excludeSchemaBindings.
excludeSchemas ArrayList - Exclude pattern for schema files.
User property is: excludeSchemas.
excludes ArrayList - Deprecated. - This name was confusing since it is used as a binding file pattern for bind and a schema file pattern for code-gen.
Use excludeSchemaBindings for binding and excludeSchemas for schema
User property is: excludes.
includeBaseBindings HashSet - A list of modules or files to search for base binding files. This can specify files in the local directory or files stored in your dependencies. If your based binding files are in a local file system, specify them as follows:
<includeBaseBindings>
  <includeBaseBinding>
    <directory>src/main/config</directory>
    <includes>
      <include>base-binding.xml</include>
    </includes>
  </includeBaseBinding>
 </includeBaseBindings>
If your based binding files are in a artifact that is one of your dependencies:
<includeBaseBindings>
  <includeBaseBinding>
    <groupId>com.mycompany.baseschema</groupId>
    <artifactId>base-schema</artifactId>
    <classifier>bindings</classifier>
    <directory>META-INF</directory>
    <includes>
      <include>base-binding.xml</include>
    </includes>
  </includeBaseBinding>
</includeBaseBindings>
The classifier is optional (if your binding file is not in the main artifact) A version is not necessary, since this declaration must be on your list of dependencies.
Note: For file filters, use the standard filter format described in the plexus DirectoryScanner.
Defaults value is: binding.xml. Include existing bindings and use mappings from the bindings for matching schema global definitions. (this is the basis for modular code generation)
Note: If directory is not specified, relative paths start at <baseBindingDirectory>.
User property is: includeBaseBindings.
includeBindings ArrayList - Deprecated. - This name was confusing, because it is not the list of binding files, but is the list of base binding files. Use includeBaseBindings instead. You will have to change your declaration slightly. From: <includeBindings>
<includeBinding>base-binding.xml</includeBinding>
</includeBindings>
To: <includeBaseBindings>
<includeBaseBinding>
<includeBindings>
<includeBinding>base-binding.xml</includeBinding>
</includeBindings>
</includeBaseBinding>
</includeBaseBindings>

User property is: includeBindings.
includeSchemaBindings ArrayList - Include pattern for schema binding files.
Note: Uses the standard filter format described in the plexus DirectoryScanner.
Defaults value is: binding.xml. Include existing bindings and use mappings from the bindings for matching schema global definitions. (this is the basis for modular code generation) Include base bindings as follows:
<includeSchemaBindings>
  <includeSchemaBinding>base-binding.xml</includeSchemaBinding>
</includeSchemaBindings>
Note: Relative paths start at <directory>.
User property is: includeSchemaBindings.
includeSchemas ArrayList - Include pattern for schema files.
Note: Uses the standard filter format described in the plexus DirectoryScanner.
Defaults value is: *.xsd.
User property is: includeSchemas.
includes ArrayList - Deprecated. - This name was confusing since it is used as a binding file pattern for bind and a schema file pattern for code-gen.
Use includeSchemaBindings for binding and includeSchemas for schema.
Note: Uses the standard filter format described in the plexus DirectoryScanner.
Defaults value is: binding.xml.
User property is: includes.
modules HashSet - A list of modules to search for binding files in the format: groupID:artifactID
User property is: modules.
options Map - Extra options to be given for customization via CLI.Enter extra customizations or other command-line options.
The extra customizations are described on the CodeGen customizations page
The single character CodeGen commands may also be supplied here.
For example, to include a base binding file (-i) and prefer-inline code, supply the following options:
<options>
  <i>base-binding.xml</i>
  <prefer-inline>true</prefer-inline>
</options>

schemaBindingDirectory String - The directory which contains schema binding files. Defaults to "src/main/config" (or "src/test/config" for test goals). For code-gen or if the default directory does not exist, defaults to "target/generated-sources" (or "target/generated-test-sources" for test goals).
User property is: schemaBindingDirectory.
schemaLocation String - The directory or web location which contains XSD files. This can be the schema directory, url, or the base url for a list of <includes> schema (See example). Defaults to "src/main/config" (or "src/test/config" for test cases).
User property is: schemaLocation.
targetDirectory String - Deprecated. - This param is now the same as in the bind goal; change it to schemaBindingDirectory. Defaults to "target/generated-sources" (or "target/generated-test-sources" for test cases)
User property is: targetDirectory.

Parameter Details

baseBindingDirectory:

Get the default location of the base binding files.
Defaults value is: schemaBindingDirectory.
  • Type: java.lang.String
  • Required: No
  • User Property: baseBindingDirectory

customizations:

Include pattern for customization files.
  • Type: java.util.ArrayList
  • Required: No
  • User Property: customizations

defaultNamespace:

Namespace applied in code generation when no-namespaced schema definitions are found (to generate no-namespaced schemas as though they were included in a particular namespace)
  • Type: java.lang.String
  • Required: No

defaultPackage:

Default package for code generated from schema definitions with no namespace.
  • Type: java.lang.String
  • Required: No

directory:

Deprecated. - Since binding and codegen use this for different directories, use schemaLocation. Defaults to "src/main/config" (or "src/test/config" for test cases).
The directory which contains XSD files.
  • Type: java.lang.String
  • Required: No
  • User Property: directory

excludeSchemaBindings:

Exclude pattern for schema binding files.
  • Type: java.util.ArrayList
  • Required: No
  • User Property: excludeSchemaBindings

excludeSchemas:

Exclude pattern for schema files.
  • Type: java.util.ArrayList
  • Required: No
  • User Property: excludeSchemas

excludes:

Deprecated. - This name was confusing since it is used as a binding file pattern for bind and a schema file pattern for code-gen.
Use excludeSchemaBindings for binding and excludeSchemas for schema
Exclude pattern for binding files.
  • Type: java.util.ArrayList
  • Required: No
  • User Property: excludes

includeBaseBindings:

A list of modules or files to search for base binding files. This can specify files in the local directory or files stored in your dependencies. If your based binding files are in a local file system, specify them as follows:
<includeBaseBindings>
  <includeBaseBinding>
    <directory>src/main/config</directory>
    <includes>
      <include>base-binding.xml</include>
    </includes>
  </includeBaseBinding>
 </includeBaseBindings>
If your based binding files are in a artifact that is one of your dependencies:
<includeBaseBindings>
  <includeBaseBinding>
    <groupId>com.mycompany.baseschema</groupId>
    <artifactId>base-schema</artifactId>
    <classifier>bindings</classifier>
    <directory>META-INF</directory>
    <includes>
      <include>base-binding.xml</include>
    </includes>
  </includeBaseBinding>
</includeBaseBindings>
The classifier is optional (if your binding file is not in the main artifact) A version is not necessary, since this declaration must be on your list of dependencies.
Note: For file filters, use the standard filter format described in the plexus DirectoryScanner.
Defaults value is: binding.xml. Include existing bindings and use mappings from the bindings for matching schema global definitions. (this is the basis for modular code generation)
Note: If directory is not specified, relative paths start at <baseBindingDirectory>.
  • Type: java.util.HashSet
  • Required: No
  • User Property: includeBaseBindings

includeBindings:

Deprecated. - This name was confusing, because it is not the list of binding files, but is the list of base binding files. Use includeBaseBindings instead. You will have to change your declaration slightly. From: <includeBindings>
<includeBinding>base-binding.xml</includeBinding>
</includeBindings>
To: <includeBaseBindings>
<includeBaseBinding>
<includeBindings>
<includeBinding>base-binding.xml</includeBinding>
</includeBindings>
</includeBaseBinding>
</includeBaseBindings>
Include pattern for binding files.
  • Type: java.util.ArrayList
  • Required: No
  • User Property: includeBindings

includeSchemaBindings:

Include pattern for schema binding files.
Note: Uses the standard filter format described in the plexus DirectoryScanner.
Defaults value is: binding.xml. Include existing bindings and use mappings from the bindings for matching schema global definitions. (this is the basis for modular code generation) Include base bindings as follows:
<includeSchemaBindings>
  <includeSchemaBinding>base-binding.xml</includeSchemaBinding>
</includeSchemaBindings>
Note: Relative paths start at <directory>.
  • Type: java.util.ArrayList
  • Required: No
  • User Property: includeSchemaBindings

includeSchemas:

Include pattern for schema files.
Note: Uses the standard filter format described in the plexus DirectoryScanner.
Defaults value is: *.xsd.
  • Type: java.util.ArrayList
  • Required: No
  • User Property: includeSchemas

includes:

Deprecated. - This name was confusing since it is used as a binding file pattern for bind and a schema file pattern for code-gen.
Use includeSchemaBindings for binding and includeSchemas for schema.
Note: Uses the standard filter format described in the plexus DirectoryScanner.
Defaults value is: binding.xml.
Include pattern for binding files.
  • Type: java.util.ArrayList
  • Required: No
  • User Property: includes

modules:

A list of modules to search for binding files in the format: groupID:artifactID
  • Type: java.util.HashSet
  • Required: No
  • User Property: modules

multimodule:

Control flag multi-module mode.
  • Type: boolean
  • Required: Yes
  • User Property: multi-module
  • Default: false

options:

Extra options to be given for customization via CLI.Enter extra customizations or other command-line options.
The extra customizations are described on the CodeGen customizations page
The single character CodeGen commands may also be supplied here.
For example, to include a base binding file (-i) and prefer-inline code, supply the following options:
<options>
  <i>base-binding.xml</i>
  <prefer-inline>true</prefer-inline>
</options>
  • Type: java.util.Map
  • Required: No

schemaBindingDirectory:

The directory which contains schema binding files. Defaults to "src/main/config" (or "src/test/config" for test goals). For code-gen or if the default directory does not exist, defaults to "target/generated-sources" (or "target/generated-test-sources" for test goals).
  • Type: java.lang.String
  • Required: No
  • User Property: schemaBindingDirectory

schemaLocation:

The directory or web location which contains XSD files. This can be the schema directory, url, or the base url for a list of <includes> schema (See example). Defaults to "src/main/config" (or "src/test/config" for test cases).
  • Type: java.lang.String
  • Required: No
  • User Property: schemaLocation

targetDirectory:

Deprecated. - This param is now the same as in the bind goal; change it to schemaBindingDirectory. Defaults to "target/generated-sources" (or "target/generated-test-sources" for test cases)
Target directory where to generate Java source files and the binding file.
  • Type: java.lang.String
  • Required: No
  • User Property: targetDirectory

verbose:

Control flag for verbose processing reports.
  • Type: boolean
  • Required: Yes
  • User Property: verbose
  • Default: false