quicktip : maven archetype for getting started with gwt

Posted on Saturday, October 16, 2010

0


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.version>2.0.4</gwt.version>
  <!--  GWT dependencies (from central repo) -->
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
      <version>${gwt.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>${gwt.version}</version>
      <scope>provided</scope>
    </dependency>
Advertisements
Posted in: Java, linux