Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAXB english comments in generated file

Tags:

maven

jaxb

xjc

I use XJC to compile some XSD to Java classes. On my machine, instead of the usual comment

// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 

I get the same comment but in italian

// Questo file è stato generato dall'architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.11 

XJC is invoked with Maven plugin maven-jaxb2-plugin:0.12.0:generate.
Same pom generates different comments on different machines. How do I switch comments back to English? I run it on JDK 1.8.0_66 on Windows 10 with Italian locale.

like image 310
Alessandro Da Rugna Avatar asked Dec 31 '15 16:12

Alessandro Da Rugna


1 Answers

You can specify a locale that will be used during generation of the classes, with the help of the <locale> attribute.

locale - Locale used during generation, for instance en, de, fr etc. This will, for instance, influence the language of the generated JavaDoc comments.

By default, maven-jaxb2-plugin will use your user locale. Sample configuration for the plugin would be:

<configuration>
  <locale>en</locale> <!-- this will use the English locale -->
</configuration>
like image 127
Tunaki Avatar answered Sep 22 '22 15:09

Tunaki