jibx:document-compare

Full name:

org.jibx:maven-jibx-plugin:1.3.1:document-compare

Description:

Compares two schemas or roundtrips a schema through a JiBX class and compares the results. If a mapped class is supplied, then the inFile is marshalled into the supplied class and then unmarshalled in the outFile (defaults to temp.xml) and compared with the original xml document. If no class is supplied, then the inFile is compared to the outFile XML files. Note: This mojo only runs in test scope.

Attributes:

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

Required Parameters

Name Type Since Description
inFile String - The path to the source XML document to compare. NOTE: Relative paths start at ${basedir}.
User property is: inFile.
multimodule boolean - Control flag multi-module mode.
Default value is: false.
User property is: multi-module.
xmlDirectory String - The directory which contains XML files.
Default value is: src/test/config.
User property is: xmlDirectory.

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.
excludeSchemaBindings ArrayList - Exclude pattern for schema binding files.
User property is: excludeSchemaBindings.
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.
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.
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.
mappedClass String - Root class name to use to round-trip the document.
User property is: mappedClass.
modules HashSet - A list of modules to search for binding files in the format: groupID:artifactID
User property is: modules.
outFile String - The path to the destination XML document to compare. NOTE: Relative paths start at ${basedir}; If this path is a filename, the directory is the same as inFile.
User property is: outFile.
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.

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

excludeSchemaBindings:

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

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

inFile:

The path to the source XML document to compare. NOTE: Relative paths start at ${basedir}.
  • Type: java.lang.String
  • Required: Yes
  • User Property: inFile

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

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

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

mappedClass:

Root class name to use to round-trip the document.
  • Type: java.lang.String
  • Required: No
  • User Property: mappedClass

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

outFile:

The path to the destination XML document to compare. NOTE: Relative paths start at ${basedir}; If this path is a filename, the directory is the same as inFile.
  • Type: java.lang.String
  • Required: No
  • User Property: outFile

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

xmlDirectory:

The directory which contains XML files.
  • Type: java.lang.String
  • Required: Yes
  • User Property: xmlDirectory
  • Default: src/test/config