GWT Maven - webapp files getting deleted when running in dev mode

我只是一个虾纸丫 提交于 2019-12-05 21:27:48

The correct way to configure the Google Plugin for Eclipse (using M2Eclipse) and run DevMode is explained in the FAQ: http://web.archive.org/web/20130619170526/https://developers.google.com/eclipse/docs/faq#gwt_with_maven

May be you have to set the copyWebapp parameter to true?

<configuration>
    <style>PRETTY</style>
    <strict>true</strict>
    <runTarget>index.html</runTarget>
      ...
    <copyWebapp>true</copyWebapp>
</configuration>

Our .pom uses this:

<properties>
    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
    <gwt.war.directory>${project.build.directory}/war</gwt.war.directory>
</properties>

In the Arguments tab of the debug configuration we use:

-remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl appname.jsp -logLevel INFO -port 8888 -codeServerPort 9997 -war "${workspace_loc:appname/target/war}" com.yourcompany.app

Seems to work without the problem you are having.

I am not sure if this is a problem faced only by me, but even after following the steps specified in the maven plugin configuration the issue had occurred to me randomly. But nowadays its not happening and this is what I did differently.

  1. Use the gwt only in eclipse java perspective, not in j2ee perspective.

  2. In eclipse->project properties->Google->Web application, check the Launch and deploy from this directory option.

I was caught out by this too. If you put your static files for the webapp into the "src/main/webapp" folder, they will be copied over to the target folder if the tickbox in Settings->Web Application is unchecked (as it would be by default if it's an M2eclipse project).

I set my target folder to be the "war" folder on the project and ignored it in version control.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!