Document toolboxDocument toolbox

Creating a new Maven + GWTproject

This section outlines what is needed to create a new Java project that is configured correctly for both Maven and GWT. To setup a project correctly, we will be depending on the gwt-maven-plugin: http://mojo.codehaus.org/gwt-maven-plugin/.

  1. From command line run the following command, and fill in all of the variables:

    mvn archetype:generate \
    -DarchetypeRepository=repo1.maven.org
    -DarchetypeGroupId=org.codehaus.mojo \
    -DarchetypeArtifactId=gwt-maven-plugin \
    -DarchetypeVersion=2.1.0-1
    
  2. By default this seems to assume you want to use java 1.5, so we need to change the following files to use 1.6:
    1. ./settings/org.eclipse.jdt.core.prefs
    2. ./settings/org.eclipse.wst.common.component
    3. ./settings/org.eclipse.wst.common.project.facet.core.xml
    4. pom.xml
  3. Once you have everything set you are ready to import the new project into eclipse.
  4. Now set the correct library path in eclipse by doing the following:
    1. Right-click the project root in the package explorer and select properties.
      1. Under the Java Build Path tab, select Libraries.
      2. Remove the 1.5 JRE library.
      3. Select Add Library...
      4. Select JRE System Library then Next, and choose a 1.6 library.
  5. Open the pom.xml in an editor and make the following changes:
    1. In the gwt-maven-plugin, comment-out the generateAsync goal as it conflicts with the GWT eclipse plugin:

      <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>gwt-maven-plugin</artifactId>
      <version>2.1.0-1</version>
      <executions>
      <execution>
      <goals>
      <goal>compile</goal>
      <goal>test</goal>
      <goal>i18n</goal>
      <\!-\- <goal>generateAsync</goal>-->
      </goals>