Create a GWT Maven Project

 ̄綄美尐妖づ 提交于 2019-12-03 03:47:50
visa

One more option:

  • Make a gwt project by using the gwt plugin in Eclipse. Now you have an Eclipse gwt project.
  • Select the project in Project Explorer, right-click it, then choose Configure. Then select Convert to Maven Project. Now you get a gwt-maven project.
  • Now add necessary dependencies to pom.xml.

Here is the relevant (I think) section from my pom setup when I was running my GWT app with the gwt:run goal:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <version>2.3.0</version>
  <configuration>
    <runTarget>/ModuleName.html</runTarget>
    <modules>
      <module>${project.groupId}.package.ModuleName</module>
    </modules>
    <copyWebapp>true</copyWebapp>
  </configuration>
  <executions>
    <execution>
      <configuration>
        <extraParam>true</extraParam>
      </configuration>
      <goals>
        <goal>compile</goal>
      </goals>
    </execution>
  </executions>
</plugin>

I should say, though, that I now use the GWT Eclipse Plugin to run my app within Eclipse, so it's been a while since I used this configuration. From what I remember reading, the "copyWebapp" "true" is one of the key pieces of configuration. It also helped me to specify the module name directly, because the gwt-maven-plugin sometimes had problems locating it.

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