欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

IDEA 2019.2.2配置Maven3.6.2打开Maven项目出现 Unable to import Maven project的问题

程序员文章站 2022-11-05 17:33:14
1. 异常现象从 intellij idea 2017.1 版本升级到当前最新版本intellij idea 2019.2.2 之后,打开原有的项目时出现异常:14:42 unable to impo...

1. 异常现象

从 intellij idea 2017.1 版本升级到当前最新版本 intellij idea 2019.2.2 之后,打开原有的项目时出现异常:

14:42 unable to import maven project
   see logs for details
   show log in explorer

IDEA 2019.2.2配置Maven3.6.2打开Maven项目出现 Unable to import Maven project的问题

intellij idea 异常日志:

2019-09-19 14:54:44,349 [2556395]  error -      #org.jetbrains.idea.maven - intellij idea 2019.2.2  build #iu-192.6603.28
2019-09-19 14:54:44,349 [2556395]  error -      #org.jetbrains.idea.maven - jdk: 11.0.3; vm: openjdk 64-bit server vm; vendor: jetbrains s.r.o
2019-09-19 14:54:44,349 [2556395]  error -      #org.jetbrains.idea.maven - os: windows 10
2019-09-19 14:54:44,352 [2556398]  error -      #org.jetbrains.idea.maven - last action: maven.showsettings
2019-09-19 14:55:06,491 [2578537]  error -      #org.jetbrains.idea.maven - com.google.inject.creationexception: unable to create injector, see the following errors:
 
1) no implementation for org.apache.maven.model.path.pathtranslator was bound.
  while locating org.apache.maven.model.path.pathtranslator
    for field at org.apache.maven.model.interpolation.abstractstringbasedmodelinterpolator.pathtranslator(unknown source)
  at org.codehaus.plexus.defaultplexuscontainer$1.configure(defaultplexuscontainer.java:350)
 
2) no implementation for org.apache.maven.model.path.urlnormalizer was bound.
  while locating org.apache.maven.model.path.urlnormalizer
    for field at org.apache.maven.model.interpolation.abstractstringbasedmodelinterpolator.urlnormalizer(unknown source)
  at org.codehaus.plexus.defaultplexuscontainer$1.configure(defaultplexuscontainer.java:350)
 
2 errors
java.lang.runtimeexception: com.google.inject.creationexception: unable to create injector, see the following errors:
 
1) no implementation for org.apache.maven.model.path.pathtranslator was bound.
  while locating org.apache.maven.model.path.pathtranslator
    for field at org.apache.maven.model.interpolation.abstractstringbasedmodelinterpolator.pathtranslator(unknown source)
  at org.codehaus.plexus.defaultplexuscontainer$1.configure(defaultplexuscontainer.java:350)
 
2) no implementation for org.apache.maven.model.path.urlnormalizer was bound.
  while locating org.apache.maven.model.path.urlnormalizer
    for field at org.apache.maven.model.interpolation.abstractstringbasedmodelinterpolator.urlnormalizer(unknown source)
  at org.codehaus.plexus.defaultplexuscontainer$1.configure(defaultplexuscontainer.java:350)
 
2 errors
 at com.google.inject.internal.errors.throwcreationexceptioniferrorsexist(errors.java:543)
 at com.google.inject.internal.internalinjectorcreator.initializestatically(internalinjectorcreator.java:159)
 at com.google.inject.internal.internalinjectorcreator.build(internalinjectorcreator.java:106)

2. 排查分析

升级前的 maven 版本是 apache maven 3.5.0,升级后版本是 apache maven 3.6.2:

IDEA 2019.2.2配置Maven3.6.2打开Maven项目出现 Unable to import Maven project的问题

1)确认 conf\settings.xml 有无问题。

2)maven 新老版本兼容有问题:

  • 当前 maven 最新版本 maven 3.6.2 有可能与最新版的 idea 有冲突或兼容问题
  • 当前 maven 最新版本 maven 3.6.2 本身存在兼容问题

 3. 解决方案

下载并使用 maven 3.6.1 与 intellij idea 2019.2.2 搭配。重新打开原有项目,问题解决。

maven 库地址:

到此这篇关于idea 2019.2.2配置maven3.6.2打开maven项目出现 unable to import maven project的问题的文章就介绍到这了,更多相关idea 配置maven出错内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

相关标签: IDEA Maven 出错