Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip the Generated on... in Java files using jaxb2 maven plugin

I'd like to get the maven-jaxb2-plugin to do not write the 'disclaimer':

This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.2-hudson-jaxb-ri-2.2-63- 
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: 2011.08.01 at 09:20:43 AM CEST 

At least the timestamp.

Thank you.

Udo.

like image 643
ssedano Avatar asked Aug 01 '11 13:08

ssedano


People also ask

What is the use of JAXB2 Maven plugin?

This plugin uses the Java API for XML Binding (JAXB), version 2+, to generate Java classes from XML Schemas (and optionally binding files) and to create XML Schemas from annotated Java classes.

What is Xsd in Maven?

We use XSD to define the contract data structure, so it's not common to generate java classes that represent the XML schema. jaxb2-maven-plugin XJC is JAXB Binding compiler tool that can be used to generate Java Classes from XSD files.


2 Answers

Use -no-header if you use command line source generator or header='false' if you use ant.

In the pom, in configuration <args><arg>-no-header</arg></args>

like image 184
Sergey Aslanov Avatar answered Sep 24 '22 12:09

Sergey Aslanov


Just to add, I use Maven and what worked for me was:

<arguments>-no-header</arguments> 
like image 39
Daniel Bonatto Avatar answered Sep 25 '22 12:09

Daniel Bonatto