MyEclipse中tomcat部署时,找不到web项目的解决方案

在MyEclipse中,使用tomcat 部署web项目时,选择项目是,按钮是灰色的,

解决方案:

原因是因为,在web项目中少了一个.mymetadata文件,或者是存在.mymetadata文件,但是 context-root 不存在。

只需要在mymetadata文本中,设置context-root="/testProject" 其中的 "/testProject" 是指的项目名称.

然后,重启MyEclipse工具, ok。 我们,在部署时,发现能选择部署按钮了。

以下是.mymetadata文件内容:可以对比以下.

Xml代码 复制代码  收藏代码
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <project-module  
  3.   type="WEB"  
  4.   name="wmba"  
  5.   id="myeclipse.1313137573642"    
  6.   context-root="/testProject"  
  7.   j2ee-spec="1.4"  
  8.   archive="wmba.war">  
  9.   <attributes>  
  10.     <attribute name="webrootdir" value="WebRoot" />  
  11.   </attributes>  
  12. </project-module>  
<?xml version="1.0" encoding="UTF-8"?>
<project-module
  type="WEB"
  name="wmba"
  id="myeclipse.1313137573642" 
  context-root="/testProject"
  j2ee-spec="1.4"
  archive="wmba.war">
  <attributes>
    <attribute name="webrootdir" value="WebRoot" />
  </attributes>
</project-module>

猜你喜欢

转载自gelei1014.iteye.com/blog/1836644