Fork me on GitHub
NOTICE There is a new plugin (archetypes and eclipse integration), a fresh start that correctly support multi-module projects, it is not version-bounded with GWT, support multiples GWT versions and other fixes, improvements and best practices. This plugin is now considered the legacy GWT maven plugin (aka mojo GWT maven plugin) and the new one is considered the new generation GWT maven plugin (aka tbroyer GWT maven plugin). The legacy maven plugin is still supported but it is strongly encouraged to use the new one for new projects.

Generate Java Interface using the CSS Interface Generator from GWT

Starting with version 2.1.1, you can generate Java Interfaces from css files. Your css must be located in resources referenced in the Maven pom The css filename is used to generate the Java class Name (so use the standard camel case).

|_src 
  |_main 
    |_resources 
      |_bar/MyCss.css 
      |_foo/MySite.css 
<project>
  [...]
  <build>
    <plugins>
      [...]
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>2.8.1</version>
        <configuration>
          <cssFiles>
            <cssFile>bar/MyCss.css</cssFile>
            <cssFile>foo/MySite.css</cssFile>
          </cssFiles>
        </configuration>
        <executions>
          <execution>
            <id>css-generation</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>css</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      [...]
    </plugins>
  </build>
  [...]
</project>

The java sources will be generated by default in ${project.build.directory}/generated-sources/gwt . This can be changed with the generateDirectory mojo parameter.