馬上要進入另一個項目組了,新項目所用的IDE是MyEclipse。我已不習慣了龐大的MyEclipse,而習慣了WTP並且想試驗一下新的Eclipse3.5,因此需要把MyEclipse項目轉換爲WTP項目。(PS:不遵守團隊開發規範是不正確的行爲!)
1.在Eclipse裏導入MyEclipse項目到工作空間。
2.編輯.project文件,在<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>
在<buildSpec></buildSpec>節點加入
<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"/>