问题背景

使用idea2021版本,Maven版本3.9.4,出现如下报错。后面把maven版本降低到3.6.1,问题解决。

问题原因

idea适配maven版本过高。

问题描述

java.lang.RuntimeException: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Unable to provision, see the following errors:  1) [Guice/ErrorInjectingConstructor]: NoSuchMethodError: DefaultModelValidator: method 'void <init>()' not found   at CustomModelValidator.<init>(CustomModelValidator.java:36)   while locating CustomModelValidator   at ClassRealm[maven.ext, parent: ClassRealm[plexus.core, parent: null]]       \_ installed by: WireModule -> PlexusBindingModule   while locating ModelValidator annotated with @Named(value="ide")  Learn more:   https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR  1 error  ====================== Full classname legend: ====================== CustomModelValidator:  "org.jetbrains.idea.maven.server.embedder.CustomModelValidator" DefaultModelValidator: "org.apache.maven.model.validation.DefaultModelValidator" ModelValidator:        "org.apache.maven.model.validation.ModelValidator" Named:                 "com.google.inject.name.Named" PlexusBindingModule:   "org.eclipse.sisu.plexus.PlexusBindingModule" WireModule:            "org.eclipse.sisu.wire.WireModule" ======================== End of classname legend: ========================        role: org.apache.maven.model.validation.ModelValidator   roleHint: ide

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐