MalformedByteSequenceException: 1字节的 UTF-8 序列的字节 1 无效
记住,每次修改了配置之后都 clean 一下,把 target 删除

第一种解决方案
去掉 pom.xml 中的 properties
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
或者在 pom.xml 中加入
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
记住每次修改配置都把 target 删除, 重新 build
第二种解决方案
打开设置 settings > Editor > File Encodings 找到 Project Encoding:
把 Project Encoding: 设置为 UTF-8


浙公网安备 33010602011771号