eclipse 官网给的解决方法是这样的:java
Unsupported IClasspathEntry kind=4
这个异常会致使项目没法使用eclipse4.2的maven功能,我升级了maven的版本仍是不行spring
英文解释以下:eclipse
Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=374332#c14maven
The problem is caused by the fact that the STS (the Spring IDE/Eclipse) uses the m2e(clipse) plugin but that eclipse:eclipse has been probably been run on the project. When m2e encounters a "var" .classpath entry, it throws this error.ide
In order to fix this problem, you need to do 2 things:this
Make sure that the version of the m2e(clipse) plugin that you're running is at least 1.1.0. The update site is here: https://repository.sonatype.org/content/repositories/forge-sites/m2e/1.1.0/N/LATEST/spa
Disable the maven nature for the project (via the right-click menu), run mvn eclipse:clean (while your project is open in STS/eclipse), and then re-enable the maven nature.插件
中文解释就是code
问题是由于使用spring ide使用了m2eclipse 插件,可是这个插件的使用前提是不容许命令 mvn eclipse:eclipse在项目上执行过,若是执行过,就会抛出这个异常。ip
现阶段修复这个问题须要作两件事
一、保证m2e插件的版本高于 1.1.0,若是没有到站点升级 :https://repository.sonatype.org/content/repositories/forge-sites/m2e/1.1.0/N/LATEST/
二、去掉项目的maven特性,右键菜单就能去除,而后执行 mvn eclipse:clean,从新引入maven工程,不是java项目。
其实这种解决方法大部分状况能够解决问题,可是有时候若是咱们使用mvn命令进行打包后,会出现classpath内容被修改了,整个maven工程被修改成java工程的classPath。即classpath中没有maven 依赖配置了,以下图:
正确的maven 工程classpath应该为:
若是出现上面的状况,咱们只须要删除第一个图中 var 开头的全部classpath配置,而后进行 mavne update 或者先将maven工程失效,而后在convert 为maven工程,便可。