控制maven 输出信息的语言

设置javac 输出

set JAVA_TOOL_OPTIONS=-Duser.language=en

JAVA_TOOL_OPTIONS=-Duser.language=en

如果用java/java.exe来启动JVM,那么在命令行上使用 -Duser.country=US 就可以把国家指定为美国。用javac/javac.exe来启动javac编译器则需要再多加个-J在前面,也就是 -J-Duser.country=US 。

maven-surefire-plugin 控制

复制代码
<camel.surefire.fork.vmargs>-XX:+ExitOnOutOfMemoryError -Duser.language=en -Duser.region=GB </camel.surefire.fork.vmargs>

                    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <argLine>@{camel.surefire.fork.vmargs}</argLine>
                    </configuration>
                </plugin>

maven-compiler-plugin 控制

复制代码
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-plugin-version}</version>
            <configuration>
                <release>${jdk.version}</release>
                <maxmem>512M</maxmem>
                <fork>${compiler.fork}</fork>
                <showDeprecation>true</showDeprecation>
                <showWarnings>true</showWarnings>
                <compilerArgs>
                    <!-- SB2 actuator endpoint requires MethodParameter metadata -->
                    <arg>-parameters</arg>
                    <arg>-J-Duser.country=US</arg>
                 </compilerArgs>
            </configuration>
        </plugin>
相关推荐
程序员清风15 小时前
程序员兼职必看:靠谱软件外包平台挑选指南与避坑清单!
java·后端·面试
皮皮林55116 小时前
利用闲置 Mac 从零部署 OpenClaw 教程 !
java
华仔啊1 天前
挖到了 1 个 Java 小特性:var,用完就回不去了
java·后端
SimonKing1 天前
SpringBoot整合秘笈:让Mybatis用上Calcite,实现统一SQL查询
java·后端·程序员
日月云棠2 天前
各版本JDK对比:JDK 25 特性详解
java
用户8307196840822 天前
Spring Boot 项目中日期处理的最佳实践
java·spring boot
JavaGuide2 天前
Claude Opus 4.6 真的用不起了!我换成了国产 M2.5,实测真香!!
java·spring·ai·claude code
IT探险家2 天前
Java 基本数据类型:8 种原始类型 + 数组 + 6 个新手必踩的坑
java
花花无缺2 天前
搞懂new 关键字(构造函数)和 .builder() 模式(建造者模式)创建对象
java
用户908324602732 天前
Spring Boot + MyBatis-Plus 多租户实战:从数据隔离到权限控制的完整方案
java·后端