在我的项目中运行MVN Install时,我出现了这个错误。虽然许多答案和资源指出/
与\
中的错误,但我想要指出的是,我没有本地更改,此repo对我团队中的其他人来说工作得很好。它以前对我来说也很好用。
- 在带有JDK 1.8.0_291的Mac OS 10.15.7上运行*
请查找完整的堆栈跟踪:
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 (TrackingFileManager.java:56)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.read (DefaultUpdateCheckManager.java:511)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkMetadata (DefaultUpdateCheckManager.java:250)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolve (DefaultMetadataResolver.java:302)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolveMetadata (DefaultMetadataResolver.java:181)
at org.apache.maven.repository.internal.DefaultVersionRangeResolver.getVersions (DefaultVersionRangeResolver.java:198)
at org.apache.maven.repository.internal.DefaultVersionRangeResolver.resolveVersionRange (DefaultVersionRangeResolver.java:148)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel (DefaultModelResolver.java:197)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally (DefaultModelBuilder.java:1070)
at org.apache.maven.model.building.DefaultModelBuilder.readParent (DefaultModelBuilder.java:846)
at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:337)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom (DefaultArtifactDescriptorReader.java:292)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor (DefaultArtifactDescriptorReader.java:171)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.resolveCachedArtifactDescriptor (DefaultDependencyCollector.java:538)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.getArtifactDescriptorResult (DefaultDependencyCollector.java:523)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:410)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:362)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:349)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse (DefaultDependencyCollector.java:506)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:362)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:349)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse (DefaultDependencyCollector.java:506)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:362)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:349)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse (DefaultDependencyCollector.java:506)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:362)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:349)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse (DefaultDependencyCollector.java:506)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:362)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:349)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse (DefaultDependencyCollector.java:506)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:362)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:349)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse (DefaultDependencyCollector.java:506)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:362)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:349)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.doRecurse (DefaultDependencyCollector.java:506)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:458)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:362)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:349)
at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:254)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies (DefaultRepositorySystem.java:284)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:169)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:243)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR]
我已经尝试了以下几种方法:
1.在Mac上重新安装了Java
1.重新安装maven
1.多次尝试使缓存无效并重新启动IntelliJ。
7条答案
按热度按时间sqyvllje1#
对我来说,这也被证明是一种腐败的依赖。
我不想经历设置调试器的过程,因此决定通过运行以下命令在我的
~/.m2
目录中查找包含\u0000
的文件:在此之后,您将获得损坏的文件,删除这些文件,然后构建maven。
请注意,如果您将存储库文件夹配置为不同于默认文件夹,则必须指定该文件夹。读取
~/.m2/settings.xml
并使用localRepository
中的值。例如:使用:
如果您希望删除所有这些文件,则将文件名通过管道传输到
xargs rm
:2g32fytz2#
要找出哪个文件格式错误(而不必删除整个Maven存储库),您可以这样调试它:
1.在
java.util.Properties
中的相关行中添加断点(如错误堆栈跟踪中所述),然后在调试模式下运行任何Maven操作。1.当代码到达该断点时,在调用堆栈中查找并选择
TrackingFileManager.read(File)
。1.现在查找导致问题的文件的路径。
1.文件格式确实有误……删除该文件(Maven将在下一次操作期间重新下载该文件)。
1.正确的文件(删除并重新下载后):
xdnvmnnf3#
在我的例子中,问题出在第三方库中,错误的char-аcter以某种方式被保存到位于
~/.m2/repository/path-to-the-library
下的solver-status.properties文件(错误行的例子:maven-metadata-nexus-releases.xml.lastUpda\u0000\u0000\....
)。我只是删除了库中的文件夹,并重新构建了项目。px9o7tmv4#
我从~/.m2目录中删除了所有构件,并重新运行了MVN构建。这次,构建成功了!
xpcnnkqh5#
实际上,这些答案中的大多数都是正确的,但有一点不完整。会显示一条消息,因为
resolver-status.properties
文件已损坏,并且它们包含\u0000,如Miccle的答案所示。删除损坏的文件并重新运行maven命令有时会有所帮助。问题有时会消失,有时不会。为什么这些文件被破坏的问题浮出水面。看起来maven在解析器https://issues.apache.org/jira/browse/MRESOLVER-216中包含了一个错误。负责解析依赖关系的多个线程的同步似乎被中断了,在某些情况下,多个线程解析相同的构件,并且它们中断
resolver-status.properties
,如MICYCLE所示。如果您的构建在删除损坏的文件后仍未成功完成,您可能希望将解析器线程限制为一个。要做到这一点,请使用JVM属性:
如果您使用的是IntelliJ IDEA,请使用
Settings->Build,Execution,Deployment->Maven->Runner
字段VMOptions
:进行此更改后,请记住删除损坏的文件(或整个
.m2
目录),因为一旦文件损坏,它们将无法修复。然后重新运行您的Maven版本。rqenqsqc6#
删除.m2文件夹并重新安装依赖项对我有效。
bjg7j2ky7#
问题可能出在您的某个依赖项中(与Alexey的建议相同)。对我来说,问题是要找到正确的依赖项,从而使解析器-status.properties损坏。有帮助的是在调试模式下运行MVN全新安装(使用Intellig配置调试),并将端点放在Properties.java中(当您使用-e或-X选项运行时,准确的行应位于堆栈跟踪中)。在调试中,您可以很容易地发现哪个依赖项已损坏,并只删除该依赖项,而不是删除整个.m2目录