-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure language for JavaDoc generation #36
Comments
Hi, any suggestion for a workaround for this? |
Hey Henning, I fixed this issue by simply putting the following option into my gradle build script: xjc {
/* This option makes sure generated javadoc is in english
* as opposed to the locale of the current system. */
options.add("-Duser.language=en")
// ...
} Worked like a charm. |
Hi @wursthos , sorry for my late reply. I already tried that before and just did so again. It does not seem to work for me. The setting does not afffect the language of generated JavaDoc comments ;-( I'm using the latest version of the xjc-gradle-plugin and have the following defined in my gradle script:
The output does not change when adjusting the language. I made sure that the gradle task is not cached. Are you sure to use the same plugin an I do and not jaxb2-maven-plugin which has dedicated support for the "-Duser.language" parameter (mojohaus/jaxb2-maven-plugin#9)? |
Hey @henning-meinhardt, you are right. I must have simultaneously changed my system locale and wrongly attributed the language change to the xjc option. Sorry about the confusion. However, I found (and properly tested) a solution that actually works well enough for me. org.gradle.jvmargs=-Duser.language=en -Duser.country=EN -Dfile.encoding=UTF-8 For the code to be regenerated in this language I had to run the clean task as well ( |
Hi, i'm missing an option to specify the language code or locale to use when invoking XJC. The current behavior is that environment variable LANG decides which language is selected for generating the JavaDoc comments in the generated files. I would like to have this reproducible, so I'd like a way to define the language on my own.
You currently use
// Set encoding (work-around for https://github.com/gradle/gradle/issues/13843) forkOptions.environment("LANG", System.getenv("LANG") ?: "C.UTF-8")
which basically passes the LANG envionment variable down to the XJC worker. But unfortunately LANG is nothing you can control from within a gradle build script or the gradle.properties file. The environment variable can only be set outside of the gradle script, i.e. its value depends on the environment found when the script runs.
My suggestion is to provide a "language" or "locale" option in the XJCExtension that is honored in the forkOptions code above.
I'm using Gradle 8.5 by the way.
Kind regards
Henning
The text was updated successfully, but these errors were encountered: