• Java异常 | Intellij IDEA 2019.2.2配置Maven3.6.2打开Maven项目出现 Unable to import Maven project


    此文转载自:https://blog.csdn.net/itanping/article/details/101024299#commentBox

    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

    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:

    1)确认 confsettings.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 库地址:https://archive.apache.org/dist/maven/maven-3/

       

    更多内容详见微信公众号:Python测试和开发

    Python测试和开发

  • 相关阅读:
    linux grep显示行数和上下行内容
    Network-Emulator Network-Emulator-Toolkit网络模拟器使用详细介绍(弱网测试工具)
    Fiddler抓包8-打断点(bpu)
    fiddler---Fiddler弱网测试
    详谈基数排序
    hadoop下的Pipes(用C++进行hadoop程序开发)
    hadoop环境安装及简单Map-Reduce示例
    每天一道面试题(2):实现strncpy
    每天一道面试题(1):快速排序
    结合源码看nginx-1.4.0之nginx多进程机制详解
  • 原文地址:https://www.cnblogs.com/phyger/p/14072893.html
Copyright © 2020-2023  润新知