JAXB 2.x Mojo. @author Aleksei Valikov (valikov@gmx.net)
Mojo Attributes:
generate-sources| Name | Type | Description |
|---|---|---|
| schemaDirectory | File |
Specifies the schema directory. Default value is src/main/resources. |
| generateDirectory | File |
Target directory for the generated code. Default value is ${project.build.directory}/generated-sources/xjc. |
| localRepository | ArtifactRepository |
Internal use. |
| pluginArtifacts | Artifact> |
Internal use. |
| Name | Type | Description |
|---|---|---|
| schemaLanguage | String |
Type of input schema language. One of: DTD, XMLSCHEMA, RELAXNG, RELAXNG_COMPACT, WSDL, AUTODETECT. If unspecified, it is assumed AUTODETECT. |
| schemaIncludes | String[] |
Specifies file patterns to include as schemas. Default value is *.xsd. |
| schemaExcludes | String[] |
Specifies file patterns of schemas to exclude. By default, nothing is excluded. |
| bindingDirectory | File |
Specifies the binding directory, defaults to the schema directory. |
| bindingIncludes | String[] |
Specifies file patterns to include as bindings. Default value is *.xjb. |
| bindingExcludes | String[] |
Specifies file patterns of bindings to exclude. By default, nothing is excluded. |
| disableDefaultExcludes | boolean |
If set to true, Maven default exludes are NOT added to all the excludes lists. Default value is false. |
| catalog | File |
Specify the catalog file to resolve external entity references (XJC -catalog option). |
| catalogResolver | String |
Class name of the catalog resolver. Default value is com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver. |
| generatePackage | String |
The generated classes will all be placed under this Java package, unless otherwise specified in the schemas. If left unspecified, the package will be derived from the schemas only. |
| addCompileSourceRoot | boolean |
If set to true (default), adds target directory as a compile source root of this Maven project. Default value is true. |
| addTestCompileSourceRoot | boolean |
If set to true, adds target directory as a test compile source root of this Maven project. Default value is false. Default value is false. |
| readOnly | boolean |
If true, the generated Java source files are set as read-only (XJC's -readOnly option). Default value is false. |
| extension | boolean |
If true, the XJC binding compiler will run in the extension mode (XJC's -extension option). Otherwise, it will run in the strict conformance mode. Please note that you must enable the extension mode if you use vendor extensions in your bindings. Default value is false. |
| strict | boolean |
If true, XJC will perform strict validation of the input schema. If strict is set to false XJC will be run with -nv, this disables strict validation of schemas. Default value is true. |
| writeCode | boolean |
If set to false, the plugin will not write the generated code to disk. Default value is true. |
| verbose | boolean |
If true, the plugin and the XJC compiler are both set to verbose mode (XJC's -verbose option). It is automatically set to true when Maven is run in debug mode (mvn's -X option). Default value is false. |
| debug | boolean |
If true, the XJC compiler is set to debug mode (XJC's -debug option). Default value is false. |
| args | String> |
A list of extra XJC's command-line arguments (items must include the dash "-"). Use this argument to enable the JAXB2 plugins you want to use. |
| forceRegenerate | boolean |
If true, no up-to-date check is performed and the XJC always re-generates the sources. Otherwise schemas will only be recompiled if anything has changed. Default value is false. |
| removeOldOutput | boolean |
If true, the generateDirectory will be deleted before the XJC binding compiler recompiles the source files. Default is false. Default value is false. |
| produces | String[] |
Specifies patters of files produced by this plugin. This is used to check if produced files are up-to-date. Default value is **/*.*, **/*.java, **/bgm.ser, **/jaxb.properties. |
| otherDepends | File[] |
A list of of input files or URLs to consider during the up-to-date. By default it always considers: 1. schema files, 2. binding files, 3. catalog file, and 4. the pom.xml file of the project executing this plugin. |
| episodeFile | File |
Target location of the episode file. By default it is target/generated-sources/xjc/META-INF/sun-jaxb.episode so that the episode file will appear as META-INF/sun-jaxb.episode in the JAR - just as XJC wants it. |
| episode | boolean |
If true, the episode file (describing mapping of elements and types to classes for the compiled schema) will be generated. Default value is true. |
| plugins | Dependency[] |
Configures artifacts of the custom JAXB2 plugins you want to use. |
| episodes | Dependency[] |
If you want to use existing artifacts as episodes for separate compilation, configure them as episodes/episode elements. It is assumed that episode artifacts contain an appropriate META-INF/sun-jaxb.episode resource. |
| specVersion | String |
Version of the JAXB specification (ex. 2.0, 2.1 or 2.2). Default value is 2.1. |
| artifactResolver | ArtifactResolver |
No description. |
| artifactMetadataSource | ArtifactMetadataSource |
No description. |
| artifactFactory | ArtifactFactory |
No description. |
| mavenProjectBuilder | MavenProjectBuilder |
No description. |
Type of input schema language. One of: DTD, XMLSCHEMA, RELAXNG, RELAXNG_COMPACT, WSDL, AUTODETECT. If unspecified, it is assumed AUTODETECT.
java.lang.StringNo${maven.xjc2.schemaLanguage}Specifies the schema directory.
java.io.FileYes${maven.xjc2.schemaDirectory}src/main/resourcesSpecifies file patterns to include as schemas. Default value is *.xsd.
java.lang.String[]NoSpecifies file patterns of schemas to exclude. By default, nothing is excluded.
java.lang.String[]NoSpecifies the binding directory, defaults to the schema directory.
java.io.FileNo${maven.xjc2.bindingDirectory}Specifies file patterns to include as bindings. Default value is *.xjb.
java.lang.String[]NoSpecifies file patterns of bindings to exclude. By default, nothing is excluded.
java.lang.String[]NoIf set to true, Maven default exludes are NOT added to all the excludes lists.
booleanNo${maven.xjc2.disableDefaultExcludes}falseSpecify the catalog file to resolve external entity references (XJC -catalog option).
java.io.FileNo${maven.xjc2.catalog}Class name of the catalog resolver.
java.lang.StringNo${maven.xjc2.catalogResolver}com.sun.org.apache.xml.internal.resolver.tools.CatalogResolverThe generated classes will all be placed under this Java package, unless otherwise specified in the schemas. If left unspecified, the package will be derived from the schemas only.
java.lang.StringNo${maven.xjc2.generatePackage}Target directory for the generated code.
java.io.FileYes${maven.xjc2.generateDirectory}${project.build.directory}/generated-sources/xjcIf set to true (default), adds target directory as a compile source root of this Maven project.
booleanNo${maven.xjc2.addCompileSourceRoot}trueIf set to true, adds target directory as a test compile source root of this Maven project. Default value is false.
booleanNo${maven.xjc2.addTestCompileSourceRoot}falseIf true, the generated Java source files are set as read-only (XJC's -readOnly option).
booleanNo${maven.xjc2.readOnly}falseIf true, the XJC binding compiler will run in the extension mode (XJC's -extension option). Otherwise, it will run in the strict conformance mode. Please note that you must enable the extension mode if you use vendor extensions in your bindings.
booleanNo${maven.xjc2.extension}falseIf true, XJC will perform strict validation of the input schema. If strict is set to false XJC will be run with -nv, this disables strict validation of schemas.
booleanNo${maven.xjc2.strict}trueIf set to false, the plugin will not write the generated code to disk.
booleanNo${maven.xjc2.writeCode}trueIf true, the plugin and the XJC compiler are both set to verbose mode (XJC's -verbose option). It is automatically set to true when Maven is run in debug mode (mvn's -X option).
booleanNo${maven.xjc2.verbose}falseIf true, the XJC compiler is set to debug mode (XJC's -debug option).
booleanNo${maven.xjc2.debug}falseA list of extra XJC's command-line arguments (items must include the dash "-"). Use this argument to enable the JAXB2 plugins you want to use.
java.util.List<java.lang.String>NoIf true, no up-to-date check is performed and the XJC always re-generates the sources. Otherwise schemas will only be recompiled if anything has changed.
booleanNo${maven.xjc2.forceRegenerate}falseIf true, the generateDirectory will be deleted before the XJC binding compiler recompiles the source files. Default is false.
booleanNo${maven.xjc2.removeOldOutput}falseSpecifies patters of files produced by this plugin. This is used to check if produced files are up-to-date. Default value is **/*.*, **/*.java, **/bgm.ser, **/jaxb.properties.
java.lang.String[]NoA list of of input files or URLs to consider during the up-to-date. By default it always considers: 1. schema files, 2. binding files, 3. catalog file, and 4. the pom.xml file of the project executing this plugin.
java.io.File[]NoTarget location of the episode file. By default it is target/generated-sources/xjc/META-INF/sun-jaxb.episode so that the episode file will appear as META-INF/sun-jaxb.episode in the JAR - just as XJC wants it.
java.io.FileNo${maven.xjc2.episodeFile}If true, the episode file (describing mapping of elements and types to classes for the compiled schema) will be generated.
booleanNo${maven.xjc2.episode}trueConfigures artifacts of the custom JAXB2 plugins you want to use.
org.apache.maven.model.Dependency[]NoIf you want to use existing artifacts as episodes for separate compilation, configure them as episodes/episode elements. It is assumed that episode artifacts contain an appropriate META-INF/sun-jaxb.episode resource.
org.apache.maven.model.Dependency[]NoVersion of the JAXB specification (ex. 2.0, 2.1 or 2.2).
java.lang.StringNo2.1No Description.
org.apache.maven.artifact.resolver.ArtifactResolverNoNo Description.
org.apache.maven.artifact.metadata.ArtifactMetadataSourceNoNo Description.
org.apache.maven.artifact.factory.ArtifactFactoryNoInternal use.
org.apache.maven.artifact.repository.ArtifactRepositoryYes${localRepository}No Description.
org.apache.maven.project.MavenProjectBuilderNoInternal use.
java.util.List<org.apache.maven.artifact.Artifact>Yes${plugin.artifacts}