侧边栏壁纸
博主头像
侯秀荣

贪婪和恐惧是人性的两大弱点,
人类几万年,人性也没进步1厘米。

  • 累计撰写 172 篇文章
  • 累计收到 3 条评论

Maven编译提示“Malformed \uxxxx encoding”

2023-12-13 / 0 评论 / 1729 阅读

java.lang.IllegalArgumentException: Malformed \uxxxx encoding.

at java
.util.Properties.loadConvert (Properties.java:672)

at java
.util.Properties.load0 (Properties.java:455)

at java
.util.Properties.load (Properties.java:408)

at org.eclipse.aether.internal.impl.TrackingFileManager.read


这种主要是因为mvn本地仓库里有些包拉取的有问题,找出来然后删除即可,原文:java.lang.IllegalArgumentException: Malformed \uxxxx encoding while mvn install

解决方案:

1、首先定位有问题的文件
grep -rnw ~/.m2 -e '\u0000'  # 自行替换 ~/.m2 文件地址,换成你的maven仓库地址

2、把查询出来的文件手动删除,再重新编译一下就可以了。

查找文件如下:
houxiurong@houxiurong ~$ grep -rnw ~/.m2 -e '\u0000'                                                                                                                                            
/Users/houxiurong/.m2/repository/...../resolver-status.properties:3:maven-metadata-lms-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
/Users/houxiurong/.m2/repository/.....2.5.0-SNAPSHOT/resolver-status.properties:14:\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
/Users/houxiurong/.m2/repository/...../2.5.0-SNAPSHOT/resolver-status.properties:4:maven-metadata-crcsoft-aurora-snapshot.xml.lastUp\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
/Users/houxiurong/.m2/repository/.....2.5.3-SNAPSHOT/resolver-status.properties:12:maven-metadata-ehs-central.xml.lastU\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
/Users/houxiurong/.m2/repository/org/jetbrains/annotations/resolver-status.properties:11:maven-metadata-cent\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
maven-metadata-cent\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=

删除项目文件对应的   resolver-status.properties 文件即可



转载自:  https://cloud.tencent.com/developer/article/2234625 作为备忘