I need to build a Maven project on a macOS 10.14 machine with Java 8.
For various reasons, I would prefer to keep my system using my "real" locale (that is, my system settings panel should list "German" as the locale, time, currency and number formats), but I need my code to be compiled using the "C" locale.
I tried setting the locale using classical Unix means, like LANG and LC_* environment variables, and also using the user.language (etc.) maven options. In both cases, I was unsuccessful: my floating point numbers were output using the German "," as decimal separator, and mvn --status
listed "de_DE" as the default locale.
It seems that macOS handles locale settings for Java a bit different than Linuxes. So, how can I get a maven job to use a different locale than the rest of the system, without
- changing my codebase (that includes the pom.xml)
- Altering macOS's system settings?