在配置Maven中出现的问题java.lang.RuntimeException: org.codehaus.plexus.component.repository.exception.Compone

出现这个问题在idea 2021中适配的过高maven,需要换低一点的,表示你的Maven版本配置过高,所以需要下载一个版本低的

原本用了3.9.1后来改了3.6.3

需要安装包可以关注

问题

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 ()' not found
  at CustomModelValidator.(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
 

解决

换一个比较低点的版本号就可以了在idea2021中

使用指令  mvn -version可以查看自己是否配置好,需要在高级设置中设置好bin路径

下载低版本的Maven,这里推荐下载Maven3.6.3版本,下载连接为https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip

在配置Maven中出现的问题java.lang.RuntimeException: org.codehaus.plexus.component.repository.exception.Compone_第1张图片

别忘记在setting中修改配置信息

在配置Maven中出现的问题java.lang.RuntimeException: org.codehaus.plexus.component.repository.exception.Compone_第2张图片

这样就配置成功了

 

你可能感兴趣的:(每日解决问题,java,maven,开发语言)