------from http://hi.baidu.com/xiongshihu/blog/item/4c8808d98ed5533e11df9b16.html
在直接Import
MyEclipse的项目文件导入到Eclipse之后,需要在项目所放的workspace内修改引入项目目录下的.project文件,修改如下:
1.增加一个<buildCommand>,代码如下:
Java代码:
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
2.修改<natures>,修改后代码如下:
Java代码:
<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>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
之后,刷新项目工程文件。继而,右键项目——>Properties——>选择Project Facets,勾选Dynamic Web Module以及Java,在Runtime内勾选Tomcat。
然后进入项目目录,在其.settings的目录下修改org.eclipse.wst.common.component内
<wb-resource deploy-path="/" source-path="/WebRoot"/>
然后再刷新项目工程文件,删除WebContent,即可在Tomcat中发布并运行。
1.请首先确保你的eclipse是javaee版本的,或者已经安装看wtp插件
2.然后修改eclipse工程下的.project文件:
3.在 <natures> </natures>中加入
Java code
1 | < nature >org.eclipse.wst.common.project.facet.core.nature</ nature > |
2 | < nature >org.eclipse.wst.common.modulecore.ModuleCoreNature</ nature > |
3 | < nature >org.eclipse.jem.workbench.JavaEMFNature</ nature > |
4.在 <buildSpec> </buildSpec>中加入
Java code
02 | <name>org.eclipse.wst.common.project.facet.core.builder</name> |
07 | <name>org.eclipse.wst.validation.validationbuilder</name> |
5.刷新项目,项目->右击->Properties->Project Facets->Modify Project,选择Java和Dynamic Web Module
配置Context Root 和Content Directory 以及源码路径.
评论