How to change javadoc comments language when gener

2019-07-13 16:34发布

I generated java sources from wsdl file using CXF wsdl2java command :

wsdl2java -impl -server -d <path_to_wsdl> <path_to_generated_java_source> 

but the generated comments are in French. How is possible to change the comments language (I want the comments in English). I could not find the option in CXF wsdl2java Documentation.

Thanks very much in advance for your answers.

标签: cxf wsdl2java
2条回答
Fickle 薄情
2楼-- · 2019-07-13 17:01

In the batch script you call (like wsdl2java.bat), as well as in the unix shell script file, Java is called with some parameters. There you can set the parameters for country (user.country) and language (user.language). So the line would looks like this:

"%JAVA_HOME%\bin\java" -Xmx128M -Duser.country=US -Duser.language=en -Dkava-endorsed.dirs=[...]

When you start the converting again, the comments are generated in English (or what ever language you define here). Worked for me on Windows. Should work on other OS as well, as you directly set Java parameters.

EDIT:

In fact it's enough to only use -Duser.language=US_en or just -Duser.language=en.

查看更多
迷人小祖宗
3楼-- · 2019-07-13 17:03

Unfortunately there is not yet an option to change the language, see JAXB jira issue. If the generated output language (e.g. german) causes encoding problems you can at least specify the encoding of the generated files (since version 2.5.4):

wsdl2java ... -encoding UTF-8 ....
查看更多
登录 后发表回答