MyEclipse web项目导入Eclipse

问题:

Performancestion是一个web项目,但是从svn上导出的时候变成了一个普通的Java项目。


解决办法:

1、首先先将项目加入tomcat中去,同时还有1.6的jdk

MyEclipse web项目导入Eclipse

2、进入项目目录,找到.project文件,增加一个<buildCommand>(如果有的话,就不用添加)

MyEclipse web项目导入Eclipse

<buildCommand>  

<span style="white-space:pre">    </span><name>org.eclipse.wst.validation.validationbuilder</name>  

    <arguments>  

    </arguments>  

</buildCommand>

3、找到<natures></natures>代码段。加入如下标签内容并保存:

<natures>  

    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>    

        <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>    

    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>     

</natures>

4、项目目录下的.classpath文件,把所有WebRoot字符串改为WebContent,保存。

5、项目目录下的.setting文件夹下的:org.eclipse.wst.common.component文件,把所有WebRoot字符串改为WebContent,保存

6、把目录下WebRoot的文件夹改名为WebContent

7、修改项目.setting文件夹下的org.eclipse.wst.common.project.facet.core.xml文件,把

<installed facet="jst.web.jstl" version="1.2.1"/>  

<installed facet="me.spring" version="4.1"/>  

这两行删除。

8、修改.classpath文件,去掉

<attribute name="owner.project.facets" value="jst.web.jstl"/>  

MyEclipse web项目导入Eclipse

9、在eclipseJava Resources:src目录的Libraries里添加web服务器需要的包,选择BiuldPath—–>configure Build Path——>当前窗面下选择选择Add Library—–>server Runtime——>选择需要的web服务器

10、在eclipse的项目上点右键,刷新项目。

11、在项目上点右键,进入属性(properties),在左侧列表项目中点击选择“Project Facets”,在右侧选择“Dynamic Web Module”和”Java”,点击保存即可。

MyEclipse web项目导入Eclipse

 

Project Facets里面,Dynamic Web Module表示web项目,Runtimes里面选择Tomcat版本