Controlling the Output - highsource/jaxb-tools GitHub Wiki
Controlling the output
generateDirectory
- Target directory for the generated code,target/generated-sources/xjc
by default.generatePackage
- The generated classes will all be placed under this Java package (XJC's-p
option), unless otherwise specified in the schemas. If left unspecified, the package will be derived from the schemas only.writeCode
- Iffalse
, the plugin will not write the generated code to disk,true
by default.readOnly
- Iftrue
, the generated Java source files are set as read-only (XJC's-readOnly
option). Default isfalse
.packageLevelAnnotations
- Iffalse
, suppresses generation of package level annotations (package-info.java
). Default istrue
. Since0.9.0
.noFileHeader
- Iftrue
, suppresses generation of a file header with timestamp. Default isfalse
. Since0.9.0
.enableIntrospection
- Iftrue
, enables correct generation of Boolean getters/setters to enable Bean Introspection apis. Since0.9.0
.removeOldOutput
- Iftrue
, thegenerateDirectory
will be deleted before the XJC binding compiler recompiles the source files. Default isfalse
.cleanPackageDirectories
- Iftrue
(default), package directories will be cleaned before the XJC binding compiler generates the source files.markGenerated
- Iftrue
, marks generated classes using a@Generated
annotation - i.e. turns on XJC-mark-generated
option. Default isfalse
.encoding
- Encoding for the generated sources, defaults to${project.build.sourceEncoding
}.locale
- Locale used during generation, for instanceen
,de
,fr
etc. This will, for instance, influence the language of the generated JavaDoc comments.
Adding target directory as Maven source directory
By default, target directory (target/generated-sources/xjc
) will be added as a compile source root.
If your project also generates the episode file, it will be added as a project resource.
In some cases you may need to generate test
sources instead of main
sources.
So you'll need to add target directory as a test
compile source root.
Or you may need to override or avoid automatic source root addition for some other reason.
You can accomplish this using the following configuration options:
addCompileSourceRoot
- If set totrue
(default), adds target directory as a compile source root of this Maven project.addTestCompileSourceRoot
- If set totrue
, adds target directory as a test compile source root of this Maven project. Default value isfalse
.