quicktip : maven archetype for getting started with gwt

Posted on Saturday, October 16, 2010


For quickly starting with gwt chances are that you would look at the codehaus gwt-maven-plugin, chances are also that it would not work for you. Since on their archetype page, they mention the following command

mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-simple-archetype -DarchetypeVersion=1.3 -DgroupId=myGroupId -artifactId=myArtifactId

but the command which would work for you is

mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=1.2 -DgroupId=myGroupId -DartifactId=myArtifactId

Once you have your project created, use the following to see that you are able to get the gwt window

mvn clean install gwt:run

You should get a swing window like this

If you do not get the window and get and error like this

[INFO] Running junit.framework.TestSuite@1971afc
[ERROR] ** Unable to load Mozilla for hosted mode **
[ERROR] java.lang.UnsatisfiedLinkError: /home/vikas/.m2/repository/com/google/gwt/gwt-dev/1.7.1/mozilla-1.7.12/libxpcom.so: libstdc++.so.5: cannot open shared object file: No such file or directory

at least this is what i get on my linux system then be sure to bump up the gwt dependency to 2.0.x

  <!-- convenience to define GWT version in one place -->
  <!--  GWT dependencies (from central repo) -->
Posted in: Java, linux