出现这个问题在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 <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
解决
换一个比较低点的版本号就可以了在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
别忘记在setting中修改配置信息
这样就配置成功了文章来源:https://www.toymoban.com/news/detail-827136.html
文章来源地址https://www.toymoban.com/news/detail-827136.html
到了这里,关于在配置Maven中出现的问题java.lang.RuntimeException: org.codehaus.plexus.component.repository.exception.Compone的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!