工程名称原来为old,发布到tomcat webapps下后为old,
右键点击你的项目,然后选择重构---->重命名,项目名称改为new,但是发布名还是原来的名字。如果想让发布后的目录名为new,
按如下方法修改即可:
第一种方法:
打开工程所在目录,找到一个 .mymetadata的文件,用写字板打开,内容大致如下:
<?
xml version="1.0" encoding="UTF-8"
?>
< project-module
type ="WEB"
name ="action"
id ="myeclipse.1242011546906"
context-root ="/old"
j2ee-spec ="1.4"
archive ="old.war" >
< attributes >
< attribute name ="webrootdir" value ="/WebRoot" />
</ attributes >
</ project-module >
< project-module
type ="WEB"
name ="action"
id ="myeclipse.1242011546906"
context-root ="/old"
j2ee-spec ="1.4"
archive ="old.war" >
< attributes >
< attribute name ="webrootdir" value ="/WebRoot" />
</ attributes >
</ project-module >
context-root="/old" 为发布后的目录名,改为 context-root="/new" 之后,用eclipse重新发布的目录名就是new了。如果用war的打包方式发布,则将 archive="old.war"> 改为 archive="new.war">。
第二种方法更为简单:
右键点击你的项目,然后选择属性---->然后点击myeclipse-web选项,修改web context-root名称为你要修改的项目名称和前面重命名的名称一致就可以了。