Closed TheSnoozer closed 9 years ago
Added support for setting the locale explicitly for both SchemaGen and XJC. Added ITs.
Parameter used is locale
, and commit id is 5c61455.
Closing this issue. Feature will be released in the upcoming 2.2 release of the Jaxb2-Maven-Plugin.
@lennartj, awsome, thanks for the work done I highly appreciate it :-)
Hi, I think it would be really great if the plugin could offer a property to set the locale of the (xjc) generated files manually. I know that's not officially supported by xjc to set the language (so setting with
-Duser.language=en -Duser.country=US
or similar will have zero effect). I played around a bit and went on a big search how to conquer my problem. I figured out that we could change the locale of the generated files by invokingLocale.setDefault
, then generating the files and then return to the local that was present before. I found this idea in a very similar maven-project (https://github.com/highsource/maven-jaxb2-plugin/blob/master/plugin-core/src/main/java/org/jvnet/jaxb2/maven2/RawXJC2Mojo.java#L306).In case you'll close this as won't fix my current workaround is to invoke maven-antrun-plugin that overrides the default locale. In case someone is interested:
Similar issue: https://stackoverflow.com/questions/22408673/jaxb-how-to-generate-english-javadoc