MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程

MyElipse导入项目报错 Version of Spring Facet could not be detected.

运行环境

  • Windows10 家庭版
  • Java 1.8.0_144
  • MyEclipse Professional 2014
  • SSM框架

错误描述

从git上clone了一个之前写的项目,发现import的时候报错“Version of Spring Facet could not be detected”。

错误截图

MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程

解决方法

截图上有一个“Operation to be performed”,提供了解决方法“Install Spring Facet”。应该就是这台电脑没有安装Maven的相关环境。
解决操作如下:
1. 关闭导入项目的窗口
(1)点击Cancel
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
(2) 点击“YES”**MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
(3) 删除该项目
右击该项目选择delete,注意不要选择在disk上删除,这样会删掉项目的源文件。
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
2. 安装Maven
安装之前,你可以先在cmd中,输入mvn -v看看是否安装了Maven。
如图所示,我的电脑的确没有安装Maven。
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
安装Maven的教程可以参考百度或者这个教程
如图所示,我现在maven已经安装成功了。
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
3. Myeclipse安装Maven插件
(1)在Myeclipse的工具栏选择 Window–>Preferences 搜索maven,如下图所示
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
(2) 添加本地maven
在侧边栏点击Installation–>Add…
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
选择Maven的安装路径,之后点击确定即可
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
(3)修改settings.xml路径
选择左侧的User Settiing–>Browse 选择Maven安装位置的conf文件夹下的setting.xml文件
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程

4. 配置项目的Spring

(1) 右击项目名,选择最下方的Properties,选择MyEclipse–>Project Facets
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
(2) 单击右侧Spring前面的框,选中
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
(3) 点击Apply,–> OK,应用配置。
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程
(4)等待项目进行Maven依赖库的更新及Spring的相关配置验证
在MyEclipse的右下角可以看到项目正在验证。
MyElipse导入项目报错 Version of Spring Facet could not be detected及配置Maven的教程

5. 成功