简体   繁体   English

GWT,Eclipse插件如何将项目与.gwt.xml文件一起重命名? 尝试这样做时会出错

[英]GWT, Eclipse Plugin how to rename project along with .gwt.xml file? Am getting error when try to do so

I've spent a while searching on this and nothing that I find seems relevant specifically to my issue. 我花了一段时间在这上面搜索,我找到的任何内容似乎都与我的问题无关。 I am making RPC calls so I wanted to change the path to one of my web services. 我正在进行RPC调用,所以我想改变我的一个Web服务的路径。

It was something like mytestproject and wanted to change it to finalprojectname 这就像mytestproject并希望将其更改为finalprojectname

I went to the mytestproject.gwt.xml file and changed <module rename-to='mytestproject'> to <module rename-to='finalprojectname'> 我转到mytestproject.gwt.xml文件并将<module rename-to='mytestproject'>更改为<module rename-to='finalprojectname'>

I then ran it through and got an error that [ERROR] Unable to find 'org/ediscovery/gwt/mytestproject.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source? 然后我运行它并得到一个错误, [ERROR] Unable to find 'org/ediscovery/gwt/mytestproject.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source? [ERROR] Unable to find 'org/ediscovery/gwt/mytestproject.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

I then changed mytestproject.gwt.xml to finalprojectname.gwt.xml but still got the same result. 然后我将mytestproject.gwt.xml更改为finalprojectname.gwt.xml但仍然得到相同的结果。

I've looked through every possible file and can't find why it thinks the project is still named mytestproject . 我查看了每个可能的文件,但无法找到为什么它认为该项目仍然命名为mytestproject I have cleaned and rebuilt the project, etc but still the same. 我已经清理并重建了项目等,但仍然是一样的。 I am still fairly new to Java so maybe I am missing something obvious. 我仍然是Java的新手,所以也许我错过了一些明显的东西。 I would greatly appreciate if anyone can offer any advice. 如果有人能提供任何建议,我将不胜感激。 Thanks 谢谢

To rename a project from "mytestproject" to "finalprojectname": 要将项目从“mytestproject”重命名为“finalprojectname”:

  1. In your .gwt.xml file, change 在.gwt.xml文件中,进行更改
    rename-to="mytestproject" to rename-to="mytestproject" to
    rename-to="finalprojectname" . rename-to="finalprojectname"

  2. In your .html file, change 在.html文件中,更改
    src="mytestproject/mytestproject.nocache.js" to src="mytestproject/mytestproject.nocache.js"
    src="finalprojectname/finalprojectname.nocache.js" (note the double replacement!) src="finalprojectname/finalprojectname.nocache.js" (注意双重替换!)

  3. In your web.xml file, adjust paths like 在您的web.xml文件中,调整路径,如
    <url-pattern>/mytestproject/greet</url-pattern> to <url-pattern>/mytestproject/greet</url-pattern> to
    <url-pattern>/finalprojectname/greet</url-pattern>

Anything else (like renaming packages, or renaming the .gwt.xml file) is optional. 其他任何内容(如重命名包或重命名.gwt.xml文件)都是可选的。

If you do choose to rename your .gwt.xml file afterwards, then it's necessary to delete the output folder (war/finalprojectname). 如果您之后选择重命名.gwt.xml文件,则必须删除输出文件夹(war / finalprojectname)。 In Eclipse, also delete your old Run Configuration, and then create a new one by using "Run As > Web Application". 在Eclipse中,还要删除旧的运行配置,然后使用“运行方式> Web应用程序”创建一个新的运行配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM