idea 2025.2 在Windows 11中执行maven命令中文乱码处理

以下内容来自AI

maven配置

在maven的配置文件中

apache-maven-3.9.9\conf\settings.xml

profiles中添加如下

复制代码
<profile>
		<id>utf-8</id>
		<properties>
		  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		  <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		</properties>
	  </profile>

activeProfiles中添加如下

复制代码
<activeProfile>utf-8</activeProfile>

查看maven执行是否正常,不正常再执行如下idea配置,具体配置如下

idea配置

文件编码配置

​File > Settings > Editor > File Encodings

确保以下三项均设置为 ​UTF-8​:

​Global Encoding​

​Project Encoding​

​Default encoding for properties files​(并勾选 Transparent native-to-ascii conversion)

idea内maven配置

​File > Settings > Build, Execution, Deployment > Build Tools > Maven > Runner,在 ​VM Options​ 字段中添加

-Dfile.encoding=UTF-8

至此,控制台编译中文显示会正常

相关推荐
其美杰布-富贵-李6 小时前
Spring Boot 依赖注入说明文档
java·spring boot·python
tachibana26 小时前
hot100 数组中的第K个最大元素(215)
java·数据结构·算法·leetcode
our_times6 小时前
2026年Java开发者破局指南:Spring AI 2.0 与 Agent 开发实战
java·人工智能·spring
糖果店的幽灵7 小时前
langgraph的四种state解析
java·前端·javascript·langgraph
杨充7 小时前
4.接口而非实现编程
java·后端·架构
梦梦代码精7 小时前
基于ThinkPHP6 + Vue3的家政预约系统全解析:从LBS定位到自动派单的完整实现
java·docker·开源·php·代码规范
wear工程师7 小时前
@Transactional 标了却没开事务?先看这次调用有没有经过代理
java·spring
Joey_friends7 小时前
指纹authenticate流程图
android·java·c++
郑州光合科技余经理7 小时前
家政O2O平台解析:从0搭建上门预约小程序解决方案
android·java·开发语言·前端·小程序·架构·php
野蛮人6号8 小时前
黑马天机学堂系列问题之域名无法正常使用
java·spring cloud·天机学堂