---
title: "(转)把MyEclipse项目转换为WTP项目"
author: "morzya"
date: "2010-02-21T12:01:04Z"
tags: []
categories: ["编程语言"]
slug: "myeclipse-wtp"
draft: false
lastmod: "2010-02-21T12:06:12Z"
id: 599390
url: "https://morzya.iteye.com/blog/599390"
---

1.在Eclipse里导入MyEclipse项目到工作空间。
2.编辑.project文件，
在<natures></natures>中加入

```xml
<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>
```


在<buildSpec></buildSpec>节点加入

```xml
<buildCommand>
   <name>org.eclipse.wst.common.project.facet.core.builder</name>*
   <arguments></arguments>
</buildCommand>
<buildCommand>
   <name>org.eclipse.wst.validation.validationbuilder</name>
   <arguments></arguments>
</buildCommand>
```

3.在Eclipse中刷新项目。
4.右击项目-->Properties—>Project Facets，在右边勾选Java与Dynamic Web Module，应用。
5.如果你的项目源代码文件夹不是WTP默认的src，则需要到Java Build Path中去添加相应源代码文件夹。
6.如果你的项目Web文件夹不是WTP默认的WebContent，则需要文件文件 <项目目录>/.settings/org.eclipse.wst.common.component，找到
<wb-resource deploy-path="/" source-path="/WebContent"/>
并修改，如
<wb-resource deploy-path="/" source-path="/webapp"/>