eclipse maven工程导入到MyEclipse出现"Versions of Spring facet could not be detected”的解决方法

VERSION OF SPRING FACET COULD NOT BE DETECTED.

eclipse maven工程导入到MyEclipse出现"Versions of Spring facet could not be detected”的解决方法

Maven工程迁移过程需要检测Maven工程使用的正确的Spring的版本支持。如果这个过程检测工程使用的Spring版本失败后,MyEclipse会尝试读取工程根目录下的.springBeans文件。如果这个文件不存在,这个工程迁移过程就不能继续,从而报出“VERSION OF SPRING FACET COULD NOT BE DETECTED.”错误

The migration process needs to detect the correct version of Spring support used by a project. If the process fails to detect the version based on containers used by the project, it tries to read it from the .springBeans file. If the file is missing, the migration process is unable to continue.


所以,在你迁移工程之前,你需要在工程根目录下面手动创建这个文件。在工程目录上面右击New -> File,输入文件名.springBeans(含扩展名),选择完成。.springBeans文件为打开状态。拷贝下面一段到这个文件中。

或者你可以在导入之后手动创建这个文件,然后Delete工程(注意不要勾选删除文件),重新导入一遍即可。

<?xml version="1.0" encoding="UTF-8"?>

 <beansProjectDescription>

   <springVersion>2.0</springVersion>

 </beansProjectDescription> 



You need to manually create the file in the root of the project, before invoking the Migration wizard. To do so, right-click the project, and select New>File from the menu. Enter .springBeans as the file name, and click Finish. The .springBeans file editor should open. Paste the following code into it, and save the file.

 

<?xml version="1.0" encoding="UTF-8"?>

 <beansProjectDescription>

   <springVersion>2.0</springVersion>

 </beansProjectDescription>

如果你选择在导入之前手动创建上述文件,可以忽略此步,直接按照向导next即可成功。

创建文件之后你可以在菜单栏MyEclipse -> Migrate Projects 中按提示next检验文件创建是否成功。



注意:如果你想在工程根目录下查看.springBeans文件,你需要去掉.*resources 过滤器。

选中工程根目录后,

Window -> navigation -> Show View Menu -> Filters

或直接CRTL + F10 -> Filters ,去掉.*resources前面的勾即可。



Note: The .springBeans file might not appear in the Package Explorer view; you will need to disable the.* resources filter to see it. To do so, click the white triangle (View menu) in the top-right corner of the Package Explorer view and select Filters. Next, deselect the .* resources filter, and click OK. You should now be able to see the .springBeans file.