`
chenjingbo
  • 浏览: 456220 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

将java工程转为web工程(Myeclipse无法add web capabilities的时候)

阅读更多

从svn库里导出的项目.经常会有很多杂七杂八的问题.最悲剧的是svn库里压根没上传.poject文件..这里我就说下从普通的java工程转为web工程

myeclipse本身是支持 "Add Web Project Capabilities".但是我现在的这个项目就是没有这个选项.至于为什么没有我没去深究
1 在工程根目录的.poject文件中添加

 

<natures>
		<nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature>
		<nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
		<nature>org.eclipse.jdt.core.javanature</nature>
		<nature>com.google.gwt.eclipse.core.gwtNature</nature>
		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
	</natures>

 

2 在工程根目录创建 .mymetadata(注意前面的.) 文件

<?xml version="1.0" encoding="UTF-8"?>
<project-module
  type="WEB"
  name="gongyi"
  id="myeclipse.1297404385202"
  context-root="/gongyi"
  j2ee-spec="5.0"
  archive="gongyi.war">
  <attributes>
    <attribute name="webrootdir" value="WebContent" />
  </attributes>
</project-module>

 

需要修改的是 context-root ,archive,还有下面 webrootdir的value.我这里是WebContent,一般的web项目是WebRoot.

 

差不多就这样了.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics