I use XJC to generate some Java classes, but the generated Java code contains ugly Javadoc headers.
Example:
/**
* <p> Java class for XXX complex type.
....
*/
How do I tell XJC to not generate this?
I tried -no-header
option, but it doesn't work.
That's not a header, that's a Javadoc comment on the class itself.
-no-header
removes the following style from the very top of the file
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.03.06 at 06:14:40 PM GMT
//
To remove the comments you have to post-process the file. This question details how that can be achieved: JAXB XJC Possible to suppress comment creation in generated classes?
Please see my detailed answer how to change prolog text (file header comment) in this answer: JAXB XJC Possible to suppress comment creation in generated classes?
In that particular case in short you may just:
src/main/resources/com/sun/tools/xjc/reader/xmlschema/MessageBundle_en.properties
# {0} - name-identifier-format-enum
ClassSelector.JavadocHeading = \
<p>Java class for {0}.
...to customize message in Javadoc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With