Fork me on GitHub

metaschema:generate-schemas

Full name:

dev.metaschema.java:metaschema-maven-plugin:1.1.0:generate-schemas

Description:

Goal which generates XML and JSON schemas for a given set of Metaschema modules.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is not marked as thread-safe and thus does not support parallel builds.
  • Binds by default to the lifecycle phase: generate-resources.

Required Parameters

Name Type Since Description
<outputDirectory> File - Location to generate Java source files in.
Default: ${project.build.directory}/generated-sources/metaschema

Optional Parameters

Name Type Since Description
<constraints> File[] - A list of files containing Metaschema module constraints files.
User Property: constraints
<encoding> String 2.0

Defines the encoding used for generating Java Source files.

The algorithm for finding the encoding to use is as follows (where the first non-null value found is used for encoding):

  1. If the configuration property is explicitly given within the plugin's configuration, use that value.
  2. If the Maven property project.build.sourceEncoding is defined, use its value.
  3. Otherwise use the value from the system property file.encoding.


See also: getEncoding()
Default: ${project.build.sourceEncoding}
<excludes> String[] - A set of exclusion patterns used to prevent certain files from being processed. By default, this set is empty such that no files are excluded.
<formats> List<String> - Specifies the formats of the schemas to generate. Multiple formats can be supplied and this plugin will generate a schema for each of the desired formats.

A format is specified by supplying one of the following values in a <format> subelement:

  • json - Creates a JSON Schema
  • xsd - Creates an XML Schema Definition
<includes> String[] - A set of inclusion patterns used to select which Metaschema modules are to be processed. By default, all files are processed.
<inlineChoiceDefinitions> boolean - If enabled, child definitions of a choice that are defined inline will be generated as inline types. If disabled, child definitions of a choice will always be generated as global types. This option will only be used if inlineDefinitions is also enabled.
Default: false
<inlineDefinitions> boolean - If enabled, definitions that are defined inline will be generated as inline types. If disabled, definitions will always be generated as global types.
Default: true
<metaschemaDir> File - The directory to read source metaschema from.
Default: ${basedir}/src/main/metaschema
<skip> boolean - Indicate if the execution should be skipped.
Default: false
User Property: metaschema.skip

Parameter Details

<constraints>

A list of files containing Metaschema module constraints files.
  • Type: java.io.File[]
  • Required: No
  • User Property: constraints

<encoding>

Defines the encoding used for generating Java Source files.

The algorithm for finding the encoding to use is as follows (where the first non-null value found is used for encoding):

  1. If the configuration property is explicitly given within the plugin's configuration, use that value.
  2. If the Maven property project.build.sourceEncoding is defined, use its value.
  3. Otherwise use the value from the system property file.encoding.


See also: getEncoding()
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • Default: ${project.build.sourceEncoding}

<excludes>

A set of exclusion patterns used to prevent certain files from being processed. By default, this set is empty such that no files are excluded.
  • Type: java.lang.String[]
  • Required: No

<formats>

Specifies the formats of the schemas to generate. Multiple formats can be supplied and this plugin will generate a schema for each of the desired formats.

A format is specified by supplying one of the following values in a <format> subelement:

  • json - Creates a JSON Schema
  • xsd - Creates an XML Schema Definition
  • Type: java.util.List<java.lang.String>
  • Required: No

<includes>

A set of inclusion patterns used to select which Metaschema modules are to be processed. By default, all files are processed.
  • Type: java.lang.String[]
  • Required: No

<inlineChoiceDefinitions>

If enabled, child definitions of a choice that are defined inline will be generated as inline types. If disabled, child definitions of a choice will always be generated as global types. This option will only be used if inlineDefinitions is also enabled.
  • Type: boolean
  • Required: No
  • Default: false

<inlineDefinitions>

If enabled, definitions that are defined inline will be generated as inline types. If disabled, definitions will always be generated as global types.
  • Type: boolean
  • Required: No
  • Default: true

<metaschemaDir>

The directory to read source metaschema from.
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/src/main/metaschema

<outputDirectory>

Location to generate Java source files in.
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.directory}/generated-sources/metaschema

<skip>

Indicate if the execution should be skipped.
  • Type: boolean
  • Required: No
  • User Property: metaschema.skip
  • Default: false