Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell wsdl2java not insert current timestamp into generated files?

Tags:

java

cxf

I use wsdl2java to generate DTO Java classes. It adds current timestamp into the comments section of every file generated.

How to disable those timestamps?

Because I'd like to minify changes between two wsdl2java launches (the generated java sources are under RCS).

P.S. Java 7; wsdl2java comes from org.apache.cxf:cxf-codegen-plugin:2.6.16 although version 3 is also considered.

like image 618
Pavel Vlasov Avatar asked Mar 03 '16 08:03

Pavel Vlasov


1 Answers

Use option -suppress-generated-date of underlying Apache CXF in wsdl2java configuration.

Fragment of a build.gradle file as an example:

wsdl2java {
      ...
      wsdlsToGenerate = [
              [
                      ...
                      "-suppress-generated-date",
                      ...
              ]
      ]
      ...
}

This option will change these comments in generated classes

/**
 * This class was generated by Apache CXF 3.2.7
 * 2018-11-23T10:12:12.986+02:00
 * Generated source version: 3.2.7
 *
 */

to these:

/**
 * This class was generated by Apache CXF 3.2.7
 * Generated source version: 3.2.7
 *
 */

More details: http://cxf.apache.org/docs/wsdl-to-java.html

like image 121
Alexey Avatar answered Nov 11 '22 10:11

Alexey