GWT Maven Plugin For Eclipse

If you're reaching this page from somewhere else, here's the external site for this plugin: http://mojo.codehaus.org/gwt-maven-plugin/

  • We're learning some hard lessons that the plugin on that page has issues. Starting with a working shell and then perhaps I can build an archetype on my own.
  • Compare with the GWT setup I'm using for ORMaps. This appears to work well, allowing changes to be compiled into the file we're using in the debugger.
  • The Steps attempted on 11 Jan 2014 reflect building from one of the examples in the GWT Maven repo. The others only got me so far (although I did learn a lot from those attempts).

Steps attempted on 12 Jan 2014

Trying out mgwt: https://code.google.com/p/mgwt/wiki/SetupProject

Steps attempted on 11 Jan 2014

These steps give a working example. We'll want to boil this down into my own archetype.

If it actually got me where I wanted to go. Ran into problems once I got maven upgraded, tomcat deployment plugin working. There was a classpath issue with the GAE (which would be nice to use, but not required).

* GWT Setup from Sample - Import a Prototype from the Google code samples (http://google-web-toolkit.googlecode.com/svn/trunk/samples).
* Add Global Settings to the workspace/project. (Preferences -> Maven -> Installations)
* After making these changes, need to ask Maven to update the project configuration (in Package Explorer, right-click -> Maven -> Update Project Configuration …)
* Maven Tomcat Deployment - Setup Tomcat Plugin to deploy war to external Tomcat server.
* Create Maven Archtype - How to create the archetype so we can save building this again.

Steps attempted on 28-29 Dec 2013

Following recommendations on this page: http://mojo.codehaus.org/gwt-maven-plugin/

  1. Upgraded GWT and other Eclipse plugins to latest versions.
  2. Found that JVM 1.7 is required so I upgraded this.
    1. log file is placed in <workspace>/.metadata/.log
    2. There's a way to activate one JVM/JDK versus another
  3. Ran Maven in a separate directory to generate a shell of the project which I could then import into Eclipse.
mvn archetype:generate \
   -DarchetypeGroupId=org.codehaus.mojo \
   -DarchetypeArtifactId=gwt-maven-plugin \
   -DarchetypeVersion=2.5.0-rc2
  1. Important to import the code using the Maven plugin (not the "existing projects" which is generic and doesn't understand Maven well)
  2. Learned that there was a problem downloading the gwt-user jar from phoenix (timed out after 60 seconds). Chased lots of dead-ends trying to flush the cache and repository copies, but what finally worked was to run the mvn build from the command line:
mvn generate-sources

Steps attempted on 11 Dec 2011

  1. As recommended on this page, setup the project using the following command line invocation of maven:
 mvn archetype:generate \
   -DarchetypeRepository=repo1.maven.org \
   -DarchetypeGroupId=org.codehaus.mojo \
   -DarchetypeArtifactId=gwt-maven-plugin \
   -DarchetypeVersion=2.4.0
  1. There were errors from
    1. Not having the gwt-servlet.jar in the WEB_INF/lib directory (fixed by CTRL-1)
    2. Not having the junit.framework.TestCase on the path (fixed by adding JUnit library (Add Library))

This got me to the Messages class not found compiler message which led me to this post: http://comments.gmane.org/gmane.org.google.gwt/72456. That post led me to this site: http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven

It looks like the archtype only gets you part way there. Indeed, the second post says there are still problems with that archetype

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License