JAXB英文评论生成的文件 [英] JAXB english comments in generated file

查看:78
本文介绍了JAXB英文评论生成的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用XJC将一些XSD编译为Java类。在我的机器上,而不是通常的注释

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 

使用Maven插件调用XJC maven-jaxb2-plugin:0.12.0:generate 。< br>
相同的pom在不同的机器上生成不同的注释。
如何将评论切换回英语?
我在Windows 10上使用意大利语语言环境在JDK 1.8.0_66上运行它。

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.

推荐答案

您可以指定一个区域设置将在 <的帮助下,在类的生成过程中使用code>< locale> 属性。

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


locale - 生成期间使用的区域设置,例如 en de fr 等。例如,这将影响生成的JavaDoc注释的语言。

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

默认情况下, maven-jaxb2-plugin 将使用您的用户区域设置。该插件的示例配置将是:

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>

这篇关于JAXB英文评论生成的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆