How to change javadoc comments language when gener

2019-07-13 16:40发布

问题:

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.

回答1:

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 ....


回答2:

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.



标签: cxf wsdl2java