首页 > 其他分享 >idea与maven的版本适配问题

idea与maven的版本适配问题

时间:2023-05-18 09:33:38浏览次数:41  
标签:版本 适配 idea maven CustomModelValidator org

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

那么很有可能是因为出现了兼容性问题。

idea版本与maven版本适配如下:
(根据多篇网上博客建议,maven3.6.3,是适配多数项目,尤其是老项目)
idea 2022 兼容maven 3.8.1及之前的所用版本
idea 2021 兼容maven 3.8.1及之前的所用版本
idea 2020 兼容Maven 3.6.3及之前所有版本
idea 2018 兼容Maven3.6.1及之前所有版本
解决方案,可以是重新下载相适配的版本

还有如下

不再配置MAVEN_HOME,选择Bundled (Maven 3)选项,但是项目jar包不会存到到指定目录的包下,会自动生成一个新的

标签:版本,适配,idea,maven,CustomModelValidator,org
From: https://www.cnblogs.com/Rwx666/p/17408733.html

相关文章

  • idea整合svn
    1.首先下载并安装svn,注意安装时要将commandlinedenttools选择为Willbeinstalledonlocalharddrive2.进入idea的Subversion设置项,选择tortoiseSVN中bin目录下的svn.exe3.然后到vcs中选择GetfromVesionControl,选择Versioncontrols为Subversion,以及在Repositories添......
  • IDEA的快捷键
    常用的有fori/sout/psvm+Tab即可生成循环、System.out、main方法等boilerplate样板代码例如要输入for(Useruser:users)只需输入user.for+Tab再比如,要输入Datebirthday=user.getBirthday();只需输入user.getBirthday().var+Tab即可。代码标签输入完成后,按Tab,生成代码。1.......
  • Maven - settings.xml配置
      settings.xml<?xmlversion="1.0"encoding="UTF-8"?><!--LicensedtotheApacheSoftwareFoundation(ASF)underoneormorecontributorlicenseagreements.SeetheNOTICEfiledistributedwiththisworkforadditional......
  • 聊一聊适配器模式
    接口不能用?行,我帮你适配一、概述适配器模式(Adapter),是23种设计模式中的结构型模式之一;它就像我们电脑上接口不够时,需要用到的拓展坞,起到转接的作用。它可以将新的功能和原先的功能连接起来,使由于需求变动导致不能用的功能,重新利用起来。上图的Mac上,只有两个typec接口,当我们需......
  • maven的安装步骤
    1、解压apache-maven-3.6.1-bin.zip(解压即安装)建议解压到没有中文、特殊字符的路径下。如课程中解压到E:\develop下。2、配置本地仓库2.1、在自己计算机上新一个目录(本地仓库,用来存储jar包)2.2、进入到conf目录下修改settings.xml配置文件1).使用超级记事本软件,打开setti......
  • idea配置Tomcat出现Warning: No artifacts configured 解决方法
    报错的截图解决方法 完成后启动 成功!!!!!!!!!!!!!......
  • 适配器模式
    目录适配器模式概述结构类适配器模式对象适配器模式应用场景JDK源码解析适配器模式概述如果去欧洲国家去旅游的话,他们的插座如下图最左边,是欧洲标准。而我们使用的插头如下图最右边的。因此我们的笔记本电脑,手机在当地不能直接充电。所以就需要一个插座转换器,转换器第1面插入当......
  • maven 常用命令
    Maven库:[url]http://repo2.maven.org/maven2/[/url]Maven依赖查询:[url]http://mvnrepository.com/[/url]Maven常用命令:[color=darkblue]1.创建Maven的普通java项目:mvnarchetype:create-DgroupId=packageName-DartifactId=projectName2.创建Maven的Web项目:mv......
  • maven 打包的同时将生成的jar复制到指定路径
    关资料来自百|度|知|道:<build><outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory><testOutputDirectory>src/main/webapp/WEB-INF/classes</testOutputDirectory><plugins><plugin>......
  • 解决Maven报Plugin execution not covered by lifecycle configuration
    解决Maven报Pluginexecutionnotcoveredbylifecycleconfiguration按照这个来,然后再创建maven工程和项目,可能解决问题.解禁MAVEN“Pluginexecutionnotcoveredbylifecycleconfiguration”问题[url]http://blog.sina.com.cn/s/blog_725eee7......