Maven编译提示“Malformed \uxxxx encoding”

2023-12-13 / 0评 / Java

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 作为备忘


本文共计 20243 字,感谢您的耐心浏览与评论。

声明:土豆丝不辣|版权所有,违者必究|如未注明,均为原创|转载请注明原文链接说明出处

0条回应:“Maven编译提示“Malformed \uxxxx encoding””