GWT-maven-plugin will run the GWT compiler when the project is built. If your project defines a single module, use the following configuration:

<project>
  [...]
  <build>
    <plugins>
      [...]
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.1</version>
        <executions>
          <execution>
            <configuration>
              <module>com.mycompany.gwt.Module</module>
            </configuration>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      [...]
    </plugins>
  </build>
  [...]
</project>

You can also configure compilation for multiple modules by nesting them inside a <modules> element. If none is set, the plugin will scan project source and resources directories for .gwt.xml module files.

<project>
  [...]
  <build>
    <plugins>
      [...]
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.1</version>
        <executions>
          <execution>
            <configuration>
              <modules>
                <module>com.mycompany.gwt.Module1</module>
                <module>com.mycompany.gwt.Module2</module>
                <module>...</module>
              </modules>
            </configuration>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      [...]
    </plugins>
  </build>
  [...]
</project>

You can also ignore the ''module'' parameter, so that the plugin will scan your project for gwt.xml module files.

By default, the GWT compiler is run with WARN logging. If you have compilation issues, you may want it to be more verbose. Simply add a command line option:

  -Dgwt.logLevel=[LOGLEVEL]

Where LOGLEVEL can be ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL.

The compiler style is set to its default value (OBFUSCATED) to generate compact javascript. You can override this for debugging purpose of the generated javascript by running with command line option :

  -Dgwt.style=[PRETTY|DETAILED]

The compiler will output the generated javascript in the project output folder ($project.build.directory/$project.build.finalName). For a WAR project, this matches the exploded web application root. You can override this behaviour by setting the ''outputDirectory'' parameter. For example, you may want to configure output to $basedir/src/main/webapp if you have configured your servlet container to use the "inplace" mode of the war plugin.